Answers for "c sharp how to assign a rigidbody"

C#
2

how to add reference to rigidbody 2d

public Rigidbody2D rb;
Posted by: Guest on July-09-2020
0

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.
Posted by: Guest on January-05-2021

C# Answers by Framework

Browse Popular Code Answers by Language