JS Math
Use JavaScript to perform mathematical operations on values.
Last updated
Was this helpful?
Use JavaScript to perform mathematical operations on values.
Last updated
Was this helpful?
Expression - an area to input mathematical operations/JavaScript expressions.
Result - a read only attribute previewing the result of the Expression.
Add - use this button to add more indices to the UI.
0: Number - the first index in the array
Example - adding the values of two attributes together.
Create 3 Shapes.
Create a JS Math Atom.
Connect basicShape1.position.x > jsmath.number0
Connect basicShape2.position.x > jsmath.number1
Enter n0 + n1
into the Expression input.
Connect jsmath.id > basicShape3.position.x to output the result.
Example - move one shape in X at a value of
Create 2 Shapes.
Create a JS Math Atom.
Connect basicShape1.position.x > jsmath.number0
Enter Math.sqrt(n0)
into the Expression input.
Connect jsmath.id > basicShape2.position.x
See for some JavaScript syntax.