void OnPhysicsReset(GameEventPhysicsReset inEvent)
 {
     transform.position = _position;
     transform.rotation = _rotation;
 }
Пример #2
0
        void ResetPhysics(GameEventPhysicsReset inEvent)
        {
            {
                var jointMotor = _rearWheel.HingeJoint.motor;
                jointMotor.targetVelocity = 0f;
                _rearWheel.HingeJoint.motor = jointMotor;
            }

            {
                var jointMotor = _steeringColumn.Joint.motor;
                jointMotor.targetVelocity = 0f;
                _steeringColumn.Joint.motor = jointMotor;
            }

            var rigidbodies = gameObject.GetComponentsInChildren<Rigidbody>(true);
            foreach(var rigidbody in rigidbodies)
            {
                rigidbody.velocity = Vector3.zero;
                rigidbody.angularVelocity = Vector3.zero;
                rigidbody.Sleep();
            }

            _steeringColumn.Joint.transform.localRotation = Quaternion.identity;
        }
Пример #3
0
 void ResetPhysics(GameEventPhysicsReset inEvent)
 {
     _frameRigidbody.velocity = Vector3.zero;
     _frameRigidbody.angularVelocity = Vector3.zero;
     _steeringColumn.Transform.localRotation = Quaternion.identity;
 }