in UnityProject/Assets/Scripts/NetworkingShared/NetworkPlayer.cs [129:152]
public void ReceivePosition(SimpleMessage msg, GameObject characterPrefab)
{
Debug.Log("Received Pos: " + msg.float1 + "," + msg.float2 + "," + msg.float3);
//Position
float x = msg.float1;
float y = msg.float2;
float z = msg.float3;
//Orientation
float qx = msg.float4;
float qy = msg.float5;
float qz = msg.float6;
float qw = msg.float7;
// We spawn here too as it might be the enemy spawned before us
if (this.character == null)
{
Debug.Log("Enemy not spawned yet, spawn");
this.character = GameObject.Instantiate(characterPrefab, new Vector3(x, y, z), new Quaternion(qx, qy, qz, qw));
}
// Set the target position for interpolation which is done in InterpolateToTarget on every frame
this.targetPos = new Vector3(x, y, z);
this.targetOrientation = new Quaternion(qx, qy, qz, qw);
}