Respawn teleporting

Hey,

I’m fairly new to UE4 and have followed this tutorial for respawning characters but applied it to the 2D Side Scroller Game. are the player and game mode blueprints:


Character Blueprint for respawning.


Game Mode Blueprint for respawning.

However, whenever the character hasn’t moved (and only if they haven’t moved) and I destroy the character, then it shifts a little to the right for some reason:


Start of game.


Respawn once without moving.


Respawn twice without moving.


Respawn thrice(?) without moving.

Any ideas of where to look for this movement?

Thank you for reading!

Perhaps disable the character movement component and collision capsule before spawning the new character? You should do this before calling ‘DestroyActor’.

My guess is that the next character is spawned before the capsule and movement component are disabled, and the collision handling logic within SpawnActorFromClass is shifting you slightly to the right to handle the collision.

Change the CollisionHandlingOverride property on the SpawnActorFromClass node to Always Spawn, Ignore Collisions.

As stated above, this seems to be the issue.