Using state synchronization (of my player’s transform) for my game. But, as should be expected, the players “jitter” from position to position. Is there a way to interpolate between these positions, without having to use OnSerializeNetworkView? Or should I just write my own synchronization code?
It would seem silly for Unity to implement state synchronization and then forget to implement some sort of interpolation functionality… What is the use of state sync then, anyway?
Here is my best, and might I add feeble, attempt at interpolation using state sync:
private var oldPos:Vector3;
private var newPos:Vector3;
function Start()
{
oldPos = transform.position;
}
function Update()
{
if( transform.position != oldPos )
{
newPos = transform.position;
transform.position = oldPos;
Vector3.Lerp( oldPos, newPos, .1 );
}
}
This code is attached to the object of the player that is instantiated on the network and the players simply freeze up and don’t move.
Any help is greatly appreciated.