“Unity Rigidbody membekukan semua” Kode Jawaban

Posisi beku kaku2d

public Rigidbody2D rb;

void Start()
{
	rb.constraints = RigidbodyConstraints2D.FreezeAll;
}
Comfortable Capybara

Unity Rigidbody membekukan semua

//For 3D Games, 2D is similar but uses Rigidbody2D, RigidbodyConstraints2D
public GameObject obj; // this is the actual game obj. Drag & drop in inspector
// or if this script is on the object, then get the transform.gameObject.
private Rigidbody rb; // this will reference the physics

void Start()
{
  	rb = obj.GetComponent<Rigidbody>(); // grabs the rigidbody
  	rb.constraints = RigidbodyConstraints.FreezeAll; // freeze rotation and pos
  	// This will freeze as script is loaded. You will have to use
  	// RigidyBodyConstraints.None to free physics.
{
Joshua Patterson

Unity Rigidbody membekukan semua rotasi

rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
mehmet köksal

Jawaban yang mirip dengan “Unity Rigidbody membekukan semua”

Pertanyaan yang mirip dengan “Unity Rigidbody membekukan semua”

Lebih banyak jawaban terkait untuk “Unity Rigidbody membekukan semua” di C#

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya