- Home /
Disable Rigidbody Function Start
i have a script here that is supposed to disable the rigidbody when you press play, but the rigidbody is still enabled, help me, here is the script.
var RigidbodyScript : Rigidbody;
function Start() { RigidbodyScript=gameObject.GetComponent.(); RigidbodyScript.enabled = false; }
Answer by sparkzbarca · Apr 03, 2015 at 01:04 PM
you can't disable rigidbodies at run time but you can stop them from detecting collisions.
rigidbody.DetectCollisions = false;
alternately you'll need to destroy the component and add it again later.
dont forget to mark as answered :)
Your answer
Follow this Question
Related Questions
Enable or Disable Rigid Body at Runtime? 9 Answers
Temporarily removing rigidbody and configurable joint and then replacing them 0 Answers
How do I disable all rigidbodies and colliders in a scene in unity? 2 Answers
Can't remove Rigidbody from transform in script? 8 Answers
Rigidbody velocity limiter 0 Answers