mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-10-30 22:53:37 +08:00
fix(unity): seed the server position from the spawn point
This commit is contained in:
@@ -115,6 +115,8 @@ public class PlayerController : NetworkBehaviour
|
||||
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
// Seed the authoritative position from the spawn point, not Vector3.zero
|
||||
if (IsServer) _serverPosition.Value = transform.position;
|
||||
if (!IsOwner) return;
|
||||
_clientPredictedPosition = transform.position;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user