Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

add rigidbody with code unity

//You can add it as component or via script:

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.
 
PREVIOUS NEXT
Tagged: #add #rigidbody #code #unity
ADD COMMENT
Topic
Name
6+2 =