In my game, everything works fine until the main character dies at the end. I’m using a sprite sheet for the main character and when the last hit that causes him to die makes the game crash. It says "attempt to call method ‘prepare’ (a nil value). I’m using storyboard so it changes scenes at the end of the game, so I know it clears up everything. My question is what exactly is the nil value that it is referring to?
[lua]guy.healthy = false
updateDamageBar(params)
guy:prepare(“hurt”)
guy:play()[/lua]
This is the function where it happens. The updateDamageBar method is where it eventually changes scenes at the end of the game. I tried checking to see if ‘guy’ was nil but that did not work either. Any suggestions, hints, or advice?
Thanks.