Skip to content

Instantly share code, notes, and snippets.

@maxweisel
Last active April 29, 2016 22:04
Show Gist options
  • Save maxweisel/9753d5af86fb0f22b9067ba77cd57d91 to your computer and use it in GitHub Desktop.
Save maxweisel/9753d5af86fb0f22b9067ba77cd57d91 to your computer and use it in GitHub Desktop.
void Awake()
{
/* ... */
// Create an empty game object. Attach a rigid body to use later for calculating velocity.
_controller = new GameObject();
_controllerRigidBody = _controller.AddComponent<Rigidbody>();
_controllerRigidBody.isKinematic = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment