甘酒のアプリ開発

一人でも多くの人を幸せにするアプリを作っていけたらなぁと思います。

【unity備忘録】「Rigidbody」の「Constraints」をスクリプトで制御する。回転を固定

FreezeRotationXをオンにする

 

Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX;

 

FreezeRotationYをオンにする

 

Rigidbody.constraints = RigidbodyConstraints.FreezeRotationY;

 

FreezeRotationZをオンにする

 

Rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ;

 

FreezeRotationXYZ全部をオンにする

 

Rigidbody.constraints = RigidbodyConstraints.FreezeRotation;

 

Rigidbody

リジッドボディ

Constraints

回転を固定