Download

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. Here are the player and game mode blueprints:


Character Blueprint for respawning.

af2f94c4585b1d776ac6e9a7bcfa7b4d759796f6.jpeg
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.

478dcc1e664b13b923624fc985f5eb83ccb8f270.jpeg
Respawn once without moving.

96beb96ea2cd9c46ab611f9200df1c2c9c4e7f74.jpeg
Respawn twice without moving.

0b003002c3aea4aba66c36e4986eca6d6fbb2a0a.jpeg
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.