Posts

Showing posts from May, 2013

Simple Prediction System

Suppose you have an incoming packet which has velocity, position and rotation details with it then you could extrapolation using the velocity in this manner Vector3 pos = mPacket._Pos; Vector3 vel = mPacket._Velocity; float timeStamp = mPacket._TimeStamp; float timeDelta = (NetworkManager.CurrentTime - timeStamp) / 1000; Vector3 predictedPos = pos + (vel * timeDelta); newPosition = Vector3.Lerp(newPosition, predictedPos, 0.2f);