Home > other >  Could you tell me how to make all of you guies unity3d an object always perpendicular to the horizon
Could you tell me how to make all of you guies unity3d an object always perpendicular to the horizon

Time:09-16

In detail, it is better for instance or code, please answer

CodePudding user response:

You don't write code control, originally has been levels, rigid body can lock the x, z axis does not rotate

CodePudding user response:

Void the Update () {
The transform. The up=Vetctor3. Up;
}

CodePudding user response:

Void the Update ()
{
The transform. The rotation=Quaternion. Euler (Vector3. Zero);
}
Can have a try to ensure that the object x axis and z axis to 0 can make its always vertical,
  • Related