private void FixedUpdate() { nextPosition = Controller.GetNetworkPosition(); distance = Vector2.Distance(transform.position, nextPosition); if (distance > 0.01f) { t = distance * (1 / MoveSpeed); transform.position = Vector2.Lerp(transform.position, nextPosition, t); } }
public override void NetworkStart() { if (IsServer) { enabled = false; } else { Controller = GetComponent <IMoveableObject>(); MoveSpeed = Controller.GetMoveSpeed(); transform.position = Controller.GetNetworkPosition(); } }