Hi,
I’m new to defold and .lua scripting. I want to know if it is a good idea to set a local variable in a function like in my example below:
function rotate()
local colorwheel = msg.url("colorwheel")
local spinner = msg.url("spinner")
go.animate(colorwheel, "euler.z", go.PLAYBACK_LOOP_BACKWARD, 360,go.EASING_LINEAR, 2.0)
go.animate(spinner, "euler.z", go.PLAYBACK_LOOP_FORWARD, 360,go.EASING_LINEAR, 2.0)
end
Everytime I execute the rotate function will it create a local variable and is it a good practice to set my go.animate’s url = to my local variable?
Thank you.