[Solved] Player freezes whenever teleported to a location

basically, i’m making a platformer shooter game. my player has three parts; a hitbox for damage, a hitbox for interactions and an object that plays their animations. upon dying, i want them to respawn at the beginning of the scene. i’ve tried restarting the entire scene, creating the objects upon respawn and even teleporting the player back. the first thing i mentioned and the latter worked well, but the player always remained either frozen in place or incomplete (e.g., only the damage hitbox appears which has the platformer behavior but it’s frozen.) i don’t really know how to fix this. please help.

You’ll need to provide screen snips of your events that respawn the player for us to be able to help.

my bad. here it is :slight_smile:

Do you reset the player’s health after the change in position?

yes, i do. it resets when it reaches -1.

And what makes it go from 0 to -1?

collision with enemies. here’s a screenshot. player starts with 35 health, enemies do 5 damage.

But how does the enemy hit the player if the player is being placed at 214, 312 every single frame?

sorry, i screenshotted badly. there’s a trigger once under the condition of that line of code, so the player isn’t being teleported there every single frame. only when their health reaches -1.

The first line in this screen snip below, prevents the second one from being actioned, because playerHealth will never be 0 in the second event - it’s getting set to 35 in the line above :

So I don’t get how the player ever gets placed as 214, 312.

Please show all the code around the repositioning event actions.

sorry again. the first line you mentioned was usually set to “the global variable playerHealth = -1”. it was only zero because i was testing other things out. here’s a screenshot with the aforementioned.

And where is the trigger once that you mentioned earlier to prevent it occurring over and over?

As it stands, once the player health is 0 there doesn’t appear to be anything to stop the player being repeatedly placed at 214, 312. Which has the effect of freezing the player in place.

1 Like

i’m very sorry once again. i thought i had put a trigger once, but as it turns out, i never did. thank you for being so patient with me. it’s fixed now. apologies.

1 Like