I am making a horror game and one of the monsters abilities is to randomly spawn behind the player and follow them followed with a few extra mechanics. I want it to just randomly spawn behind the player but I haven’t figured out how to achieve it
To implement the monster spawning behind the player in Blueprints, you can start by getting the player’s location using the Get Player Character node and then the Get Actor Location node. Next, you’ll calculate the position behind the player by using the Get Actor Forward Vector node to determine the direction the player is facing. By multiplying the forward vector by -1
and scaling it by a float value (representing the spawn distance), you can calculate the offset behind the player. Then, use the Vector + Vector node to add the player’s location and the calculated offset to get the spawn position. Finally, you can spawn the monster using the Spawn Actor From Class node, feeding the calculated position into the Spawn Transform input, and set the rotation if needed.