how to initialize a Rigidbody 3D in Start() code example
Example 1: unity rigid body variable
public Rigidbody rigidbody;
Example 2: c sharp how to assign a rigidbody
GameObject myGameObject = new GameObject("Test Object"); // Make a new GO.
Rigidbody gameObjectsRigidBody = myGameObject.AddComponent<Rigidbody>(); // Add the rigidbody.
gameObjectsRigidBody.mass = 5; // Set the GO's mass to 5 via the Rigidbody.