Download

Topdown template SetActorLocation not working

Hi,

I tried to implement respawn mechanics in my topdown game. But I stumbled upon this problem:

When setting the player location to the starting location, it teleports there, but the character falls through the ground, and the camera is no longer in topdown.

I then did a simple SetActorLocation in the basic topdown template, and it has the same problem.

To replicate the problem make a new topdown template project and add the code from the screenshot to TopDownCharacter blueprint. Then play the game, move a bit and press F to teleport to the starting location. Then you can see the problem

Any ideas how to solve this? Why does the camera go out of topdown mode, and why does the character fall through the floor after doing SetActorLocation?

Thanks in advance

Not sure if this is the reason alone, but assuming you are not using a VR headset then the Begin Play event never sets the Starting Location variable. Hook up the execution output pin from the lower of the Activate nodes to the Set Starting Location node and see if that works.

that worked, thanks!