Player not spawning correctly sometimes. Some help would be appreciated.

bladeolsonbladeolson Member Posts: 295
edited November -1 in Working with GS (Mac)
On one of my apps, I am having an issue. After the main guy dies he spins around then is destroyed. The the player is taken to a new "try again" screen.

The problem is that sometimes when going back to the game screen, the player re-spawns and then seems to still be running under the "destroy" sequence, he spins around then disappears and the player cannot do anything?

Any ideas why this is happening?

Blade

Comments

  • butterbeanbutterbean Member Posts: 4,315
    This is my guess off the top of my head, but if you have your healthbars under a global game attribute, and you reset scene, it only resets self attributes, not globals, so you might have to put under reset scene, change attribute game.health to X (whatever number of health your actor has) and you can set invincibility to true momentarily while the scene resets as well
  • quantumsheepquantumsheep Member Posts: 8,188
    Yep, that sounds about right.

    On your 'try again' screen, when the player presses the 'yes' actor use change behaviour to basically reset the variables you need changing (e.g. - player health =10, score =0, Timer =0, level =1 etc etc)

    You'd also want to put these on your menu screen for 'start game' I guess so that if you go back to the menu, the variables are reset there too.

    Hope that helps,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • bladeolsonbladeolson Member Posts: 295
    I think that worked! It was strange because the problem only happened sometimes. i guess depending on how many things are going on, the actor was getting destory properly and sometimes not. I think it may be happening on the slower devices, I have never seen it on my 3GS.
Sign In or Register to comment.