When I play the scene with the rotation animation it all runs, but when I change scene and then come back to the previous scene it gives me the following error on the terminal:
Users/Marco/Desktop/LOSTBird/level6.lua:175: attempt to perform arithmetic on field ‘rotation’ (a nil value)
stack traceback:
[C]: ?
/Users/Marco/Desktop/LOSTBird/level6.lua:175: in function </Users/Marco/Desktop/LOSTBird/level6.lua:174>
Either what Rob said or you need to remove the rotate event listener when you leave the scene. When you go back to the scene, it should add itself. This works for me when I leave and re-enter a scene.
Either what Rob said or you need to remove the rotate event listener when you leave the scene. When you go back to the scene, it should add itself. This works for me when I leave and re-enter a scene.