How to make CapsuleComponent of Player start movable?

I have a procedurally generated level which is built using many parameters read through a JSON file. Now, I want the player start to be moveable so that I can read the coordinates from the JSON file and spawn the pawn at the given location.

Yes, I know that I could just make the pawn teleport to the location once it has been spawned in the world, but my spawn is somewhat bounded to the Player start. So even if I were to teleport it to the desired location (which I did try), it just comes back to the player start location. any guidance on how to make the player start “movable” would be greatly appreciated. Thank you

Are you referencing the player start object type that gets placed in the scene? You want to be able to move that so that your actor start can be customized?

@Brian Spot on

If you create a custom game mode for your level you can override a function called ChoosePlayerStart. This lets you return a specific PlayerStart object to be where you player’s actor is spawned. You can keep a reference to a known PlayerStart in your GameMode and when ChoosePlayerStart is called, move that actor to the location you want and then return a reference to it.

@Brian The thing is, PlayerStart isn’t a movable object. Even if I have a reference and I know the location of where I want to move the actor, I can’t move the Player start. Hence, the title of the question.

If you were able to get a reference to your spawned actor and teleport it, what happens if you have no PlayerStart objects in the scene at all? Once teleported the engine wouldn’t then try to set your character back to any PlayerStart location.

I tried that too. Doesn’t work that way. Unfortunately, the only way forward is making the CapsuleComponent “movable”

If you don’t place a PlayerStart object in the scene at all what is the behavior? Where does the actor get spawned and what happens if you use SetActorLocation on the spawned actor? Can you try adding a single frame delay and see what happens then?

the ChoosePlayerStart() just needs an AActor, so you could use an empty actor in the scene, move that, and have the gamemode reference it. The PlayerStart actor is just for convenience afaik.