[SOLVED] Attribute type number

is there a difference in the type of number that you use when making a “number attribute”?
like in Unity, you can have float, int, double, long, … but here i just find “number”. is there also a way to lock these? like you can’t enter a decimal in the “number” attribute field?

Javascript just has one type. ‘Number’ which can represent an int, double, float etc

Some reference: https://www.w3schools.com/js/js_datatypes.asp

For the editor, there is ‘precision’ and ‘step’ that could be used to restrict the data that you input into the editor: https://developer.playcanvas.com/en/api/pc.ScriptAttributes.html

3 Likes