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
asked Nov 13 '18 at 07:47 AM in C++ Programming
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.
answered Nov 14 '18 at 02:41 AMBrian Johnstone (suspended)
Follow this question
Once you sign in you will be able to subscribe for any updates here