Answers for "unity turn off rigidbody"

C#
3

how to removes the rigidbody from the game object

// Removes the rigidbody from the game object
Destroy (rigidbody);
Posted by: Guest on July-14-2021
4

how to disable and enable rigidbody unity

// if you want to disable the rigidbody on which the script is sitting on
// you can't do that but you can go around it by 

// Just destroying the rigidbody by calling
Destroy(gameObject.GetComponent<Rigidbody>());

// and if you want it again call
gameObject.AddComponent<Rigidbody>();

// Remember "gameObject" with small 'g' reffers to the gameObj on which the script
// is sitting on

// -*-*-*-*-*-***-HAPPY CODING-***-*-*-*-*-*-
Posted by: Guest on April-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language