Search code examples
unreal-engine4game-developmentspawnunreal-blueprint

Respawn or move player pawn trouble in UE4 using blueprints


I am still fairly new to UE4 but I'm trying to make a simple mini golf game.

I have set almost everything up however when I finish one hole I want the player pawn ( which is the ball) to move to the next start location. I am trying to to this in the level blueprint and have tried using the set world location, with the target being the root component of the ball pawn bp. I have also tried using the destroy actor node with the target being the ball pawn bp and spawn actor from class.

I have placed target points to the the spawn location but I have also tried to manually enter the location co-ordinates but still no luck.

I have looked online and cant find anything about respawning pawns, only actors. Any help or suggestions would be greatly appreciated!


Solution

  • How to set location of pawn: In this image you are getting a reference to the pawn and setting the location. Edit the vector to set the location to spawn.

    Blueprints

    How to destroy old actor, spawn new actor and control i: In this image you are getting a reference to the pawn and destroying it. Then you are spawning the new actor (Set class to your pawn class and spawn transform to desired spawn location as well as collision handling override). Then you are possessing your actor with the referenced player controller. You will need to do this on the server as possess requires server authority.

    Blueprints