Slider Value cant change max, min and step


Why i cant change min, max and step from this project PlayCanvas 3D HTML5 Game Engine

What can i do ? How can i change the interval from 0-100 to 100-300?


Hi @Daniel_B,

I am checking through your code and it seems in the Slider.js although you have min/max/step attributes exposed, they aren’t used anywhere in your code. Hence why they aren’t working.

You will need to implement that functionality in your code:

Slider.attributes.add('min', { type : 'number', default : 0 });
Slider.attributes.add('max', { type : 'number', default : 100 });
Slider.attributes.add('step', { type : 'number', default : 1 });
1 Like

And here i can implement this? Sorry i am new to playcanvas and I can’t figure out.

Calling @commention, he may be able to share some insight, that project is his.

1 Like

To change those values is as simple as adding the following to the initialize function.

this.element.min = this.min;
this.element.max = this.max;
this.element.step = this.step;