Hey all!
My code has my ship rotating for a total of 3 seconds (3000 in the below function)
function movementEnded(passedShip)
passedShip.stillMoving = 0
print("We got to movement ended!")
end
function turnRight(passedShip)
local degreeAmount = 30
local targetRotation = passedShip.rotation + degreeAmount
passedShip.stillMoving = 1
transition.to(passedShip, {time=3000, rotation=targetRotation, onComplete=movementEnded(passedShip)})
end
But the output from my “movementEnded” function prints IMMEDIATELY instead of after the designated 3 seconds that it’s supposed to take from my “turnRight” function. What am I doing wrong?
Any help is appreciated!
Thanks!
Mario [import]uid: 11636 topic_id: 4774 reply_id: 304774[/import]
[import]uid: 11636 topic_id: 4774 reply_id: 15252[/import]