hey ive been having alot of troble syncing my sailing boat on a network
the code i have is
void Vessel_Move_Network ()
{
Vector3 VelocityToAddFromPosition = NetworkPosition - lastpos;
Vector3 VelocityToAdd = NetworkVelocity + VelocityToAddFromPosition;
rigidbody.velocity = Vector3.Lerp(rigidbody.velocity, VelocityToAdd, 1f * Time.deltaTime);
lastpos = transform.position;
}
this is only the code for my position
this is called every frame
and updates the boat is its not owned by the client
the aim of this script is to guess where the boat will be from the last velocity got.
and move the boat along that same course but when my boat gets new information i want it to align itself. the problem im having is that if i go on the master of the boats client and move the boat in the editor this boat trys to move to the new position but have a sling shoting effect and after a couple of seconds stops sling shoting and aligns
PLEASE help. is there a better way to sync the position of my boat?
thanks ~Scott