Assets/Deps/emotitron/Network/NST/NetworkSyncTransform.cs
/// <summary>
/// Public method for initiating a Teleport. Works for the localplayer with authority, or for the server. For localplayer this generates a TELEPORT msgtype.
/// If server initiated (and not the local player) this generates a SVRTELEPORTCOMMAND msgtype, to which the localplayer needs to acknowledge with a TELEPORT msgtype.
/// Non-local player machines will ignore any messages until they receive this TELEPORT confirmation. Currently Teleport is only for position. Rotation handlers will
/// be a bit more complicated now with Rotation Elements, so I need some time to figure out how to do this correctly.
/// </summary>
Public method for initiating a Teleport. Works for the localplayer with authority, or for the server. For localplayer this generates a TELEPORT msgtype.
If server initiated (and not the local player) this generates a SVRTELEPORTCOMMAND msgtype, to which the localplayer needs to acknowledge with a TELEPORT msgtype.
Non-local player machines will ignore any messages until they receive this TELEPORT confirmation. Currently Teleport is only for position. Rotation handlers will
be a bit more complicated now with Rotation Elements, so I need some time to figure out how to do this correctly.
Public method for initiating a Teleport . Works for the localplayer with authority or for the server . For localplayer this generates a TELEPORT msgtype . If server initiated ( and not the local player ) this generates a SVRTELEPORTCOMMAND msgtype to which the localplayer needs to acknowledge with a TELEPORT msgtype . Non - local player machines will ignore any messages until they receive this TELEPORT confirmation . Currently Teleport is only for position . Rotation handlers will be a bit more complicated now with Rotation Elements so I need some time to figure out how to do this correctly .
public void Teleport(Vector3 pos)
		{
			if (!isServer && !hasAuthority)
			{
				DebugX.LogWarning("You are trying to teleport an object from a client without authority over that Network Sync Transform. Only the server or the client with Authority may teleport NST objects.");
				return;
			}
			if (isServer)
			{
				SvrCommandTeleport(this, 0, pos);
				DebugX.Log(Time.time + " <color=red>Teleport() SET WAITING TRUE  " + "</color>");
			}
			if (hasAuthority)
			{
				ApplyTeleportLocally(pos);
				clientTeleportConfirmationNeeded = true;
			}
		}
public void Teleport ( Vector3 pos ) { if ( ! isServer && ! hasAuthority ) { DebugX . LogWarning ( " " ) ; return ; } if ( isServer ) { SvrCommandTeleport ( this , 0 , pos ) ; DebugX . Log ( Time . time + " " + " " ) ; } if ( hasAuthority ) { ApplyTeleportLocally ( pos ) ; clientTeleportConfirmationNeeded = true ; } }
Public method for initiating a Teleport.
Public method for initiating a Teleport .
//Debug.Log(Time.time + " <color=green>TELEPORT called : isServer?" + isServer + " isLcLPlayer?" + hasAuthority + " </color>"); // On the server, send the teleport command to clients, and set to confirmation waiting condition. // This will ignore all incoming messages from this object until a confirmation arrives. // if the player initiated this with local authority, the next outgoing message will be of the Teleport msgtype.
pos
Vector3