Disabling rigidbody constraints in code - Freeze Position, Rotation etc
Unity3D 2012. 10. 31. 00:29I'm trying to disable a rigidbody contraint to allow movement in the Y axis using javascript. I found the page showing how to do it in the script help files, but when I tried a very minor variation of it, it doesn't work, and I get an error. Here's my line of code:
transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionY = false;
I also tried it like this:
transform.rigidbody.constraints = RigidbodyConstraints.FreezePosition = false;
and this:
transform.rigidbody.RigidbodyConstraints.FreezePosition = false;
None of those work, so simple question - How do I turn off the position freezing in code?
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY;
'Unity3D' 카테고리의 다른 글
RequireComponent (0) | 2012.11.02 |
---|---|
Unity3d Android 해상도 설정하기 ( Screen.SetResolution ) (0) | 2012.11.02 |
NGUI Scroll View (Panel) 분석 (0) | 2012.10.24 |
[펌] Unity3D - 2D 게임을 위한 텍스쳐 설정 (0) | 2012.10.22 |
2dtoolkit 한글 폰트 사용 (2) | 2012.10.22 |