Client spawns in 90 degree turn


i test my code with 2 players, one host as listen server and the other is a client player, the client players always spawns looking to the right and i cant figure out why.

Hey @Ryux33!

We’re going to need a little more information than that! :slight_smile:

We don’t have any context right now.

Let’s start by showing

The player start node
The secondary player start node (to compare rotation)

Any other beginplay code

Anything else you think is relevant!

This is the only code inside the PlayerChar except My Input Actions that control the camera Rotation

For Camera Rotation i have this as of now:

OnTurn

OnLookUp

My Players do get spawned by the GameState when all Players are “logged in” cia GameModes “Event OnPostLogin”

GameMode OnPostLogin

Game State AddNewPlayer

GameState Begin Play

I have an Actor Component on my GS that handles Round- and Matchstate

In my PlayerController i have this on beginplay

When the RoundState changes to OnRoundInProgress the server spawns my Players via Server_Set_Player

Which calls an interface event in my GS that spawns all players

The GameState Actor Component SpawnSystem spawns the Players then by first choosing a spawn location(my 4 chairs that are BP_PlayerStarts

Final SpawnPlayer Event

My Players do get spawned the right direction but the camera gets rotated to the right side for some strange reason


Also it only happens on the first Client, the Host Player is fine and the second client player is fine too

It likely has something to do with the rotation of that chair vs the skeletal mesh of the player character that has spawned in. Notice- it’s on a perpendicular plane to the Host + Client2… but the camera really WANTS it to be on the same one.

As a test- try rotating that spawn point to face the same direction as the host’s spawn point and see what happens differently.

This could lead to a few solutions.

First would be that it’s not related at all and still spawns with the camera at 90 degrees Z.

Second would be that you have an issue where the camera is not getting its direction to spawn in from the playerspawn actor.

Thirdly it could be that the spawn point and anchor for that chair are misaligned, with the chair pointing 90 degrees off from its parent.

This seems to definitely be down to the spawn point actor you’re using.

the chair is a static mesh attached to my spawn point, i rotated it inside the custom BP_PlayerStart to match the rotation of the PlayerStart.

Also for some weird reason it is always the last client that does the weird rotation e.g host+client1: client1 weird rotation, host+client1+client2: client 2 weird rotation

That’s definitely something to look into.

How does the client relate to the host? How is it being called in? If you connect Host+ C1, then wait a bit, then connect C2, does C1 correct itself?