"how to disable and enable rigidbody unity" Code Answer's
You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "how to disable and enable rigidbody unity" answered properly. Developers are finding an appropriate answer about how to disable and enable rigidbody unity related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like how to disable and enable rigidbody unity. Enter your desired code related query in the search bar and get every piece of information about C# code related question on how to disable and enable rigidbody unity.
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-***-*-*-*-*-*-
disable rigidbody unity
//This is for Unity (c#)
Rigidbody rb; //For 2D games use 'Rigidbody2D'
void Awake ()
{
rb = GetComponent<Rigidbody>();
}
// (...)
rb.bodyType = RigidbodyType2D.Static; // Deactivated
rb.bodyType = RigidbodyType2D./*The type the rigidbody was originally eg. dynamic, kinematic, or static*/; // Activated
unity rigidbody2d disable
//you can't :(
//you can delete it with
Destroy(RigidBody2D);
All those coders who are working on the C# based application and are stuck on how to disable and enable rigidbody unity can get a collection of related answers to their query. Programmers need to enter their query on how to disable and enable rigidbody unity related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to disable and enable rigidbody unity for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of how to disable and enable rigidbody unity while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "how to disable and enable rigidbody unity". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to disable and enable rigidbody unity resolved professionally and stay updated to the latest C# updates.