Last active
April 29, 2016 22:03
-
-
Save maxweisel/eae8d3c72394090be8d5f0b8e607c6d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TriggerEnded() | |
{ | |
// Throw the cube by setting the velocity on its rigid body using the rigid body on the empty game object. | |
Rigidbody rigidBody = _cube.GetComponent<Rigidbody>(); | |
rigidBody.velocity = _controllerRigidBody.GetPointVelocity(_controller.transform.TransformPoint(offset)); | |
rigidBody.angularVelocity = _controllerRigidBody.angularVelocity; | |
rigidBody.isKinematic = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment