unity when to use rigidbody code example
Example 1: get rigidbody component unity
//The Variable
Rigibody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
Example 2: unity rigidbody
private Rigidbody rigidbody
//The Variable
Rigibody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
private Rigidbody rigidbody