Firstly, thank you for this excellent example to learn and improve from.
I have a question . . .
This code works fine, but I am getting a warning message (although it doesn’t crash) that says . . .
'attempt to ‘setLinearVelocity’ (a nil value)
This is from the if shouldPoof then . . . function, under the ’ Make ghost disappear and show “poof” animation ’ heading.
It occurs when I restrart the level or go on to the next level.
I’ve tried many different ways to smooth out this glitch, including making sure the object is added as a physics body, making sure all timers and transitions are cancelled and even setting shouldPoof to nil on the restart and next level buttons etc. I’ve also included if statements but they didn’t do the trick.
Is everyone learning from this sample code getting the same warning message in the terminal window?
I’ve run out of ideas and am not seeing something (probably obvious as always )
Anybody out there with more experience than me who has fixed this glitch?
Any ideas would be appreciated. [import]uid: 12941 topic_id: 4345 reply_id: 52222[/import]