Setting Player-Start Location

 Author: Najee Jackson

Player starting not in the elevator at level start

Player starting in elevator at level start


Problem

When players load into any randomly generated level, they spawn outside the level walls. Once they spawned in, they fell infinitely. This stopped the player from progressing through the level and reaching the next. Which heavily affected the player's sense of progression and experience.

Solution

I first researched different ways to change the player start location to solve this issue. I found the RestartPlayerAtPlayerStart function, which changed the original PlayerStart to one with a specific tag. I tested this out by calling this function after I created the spawn elevator, but even though it executed this function and got the right PlayerStart, it didn't change the player spawn to be in the elevator. To fix this, I set the player's actor location to the elevator when it is created in the level for the first time. To do this, I got the elevator position when it was created and stored it in the game instance. Once that was complete, I updated the player's start location to be in the elevator when they were created.

Comments

Popular posts from this blog

Procedural Generation - Room NavMesh Spawning

Powerups and Wall clipping