Exemple #1
0
 protected virtual void Awake()
 {
     rigidbody = gameObject.GetComponent <Rigidbody>();
     // For now, we assume the set position and rotation is equal to the server one.
     // Default velocities are probably empty, but set them anyway.
     SmoothPosition        = new SmoothVector(gameObject.transform.position);
     SmoothVelocity        = new SmoothVector(rigidbody.velocity);
     SmoothRotation        = new SmoothRotation(gameObject.transform.rotation);
     SmoothAngularVelocity = new SmoothVector(rigidbody.angularVelocity);
 }