The current spawn point is always to the north of the player, not where the player is looking which can make it tricky to place. The following fixes that. Thx for the great plugin.
// NOTE: For some reason player.transform.forward is always
// Z axis, i.e., North.
Quaternion rotation = player.GetNetworkRotation();
Vector3 forward = rotation * Vector3.forward;
// Make straight perpendicular to up axis so we don't spawn
// into ground or above player's head.
Vector3 straight = Vector3.Cross(Vector3.Cross(Vector3.up, forward), Vector3.up).normalized;
Vector3 position = player.transform.position + straight * 5f;
position.y = position.y + 2f; // Spawn a bit above ground.
// NOTE: For some reason player.transform.forward is always
// Z axis, i.e., North.
Quaternion rotation = player.GetNetworkRotation();
Vector3 forward = rotation * Vector3.forward;
// Make straight perpendicular to up axis so we don't spawn
// into ground or above player's head.
Vector3 straight = Vector3.Cross(Vector3.Cross(Vector3.up, forward), Vector3.up).normalized;
Vector3 position = player.transform.position + straight * 5f;
position.y = position.y + 2f; // Spawn a bit above ground.