I wanted to know how to get planets spinning around an axis at different speeds.
I’ve been using this code for now, but I don’t know if it’s the right way. I dynamically create the planets from php and pass them in json, do the loop and then i thought to apply to each item of the loop but only the last one is animated. In another experiment I can make them all rotate but all at the same speed because the pivot is one. How am I supposed to have each planet spin at its speed?
Hey there, a simple fix is to use const or let instead of var and use the arrow function instead of function, that way new variables and function are created for each loop iteration.
Thank you very much, its’ perfect!