“2D -Rotationseinheit” Code-Antworten

Rotations -Einheitskript 2d

transform.Rotate(Vector3(0, 0, 50));
//instead of :
transform.eulerAngles = new Vector3 (0, 0, 50);
//or like you said
transform.eulerAngles = Vector3.forward * 50;
Xerothermic Xenomorph

2D -Rotationseinheit

// Rotation scripting with Euler angles correctly.
// Store the Euler angle in a class variable, and only use it to
// apply it as a Euler angle, but never rely on reading the Euler back.
        
float x;
void Update () 
    {
        x += Time.deltaTime * 10;
        transform.rotation = Quaternion.Euler(x,0,0);
    }
Inexpensive Impala

Rotations -Einheitskript 2d

transform.eulerAngles = Vector3.forward * degrees;
// or
transform.rotation = Quaternion.Euler(Vector3.forward * degrees);
// or
transform.rotation = Quaternion.LookRotation(Vector3.forward, yAxisDirection);
// or
transform.LookAt(Vector3.forward, yAxisDirection);
// or
transform.right = xAxisDirection;
// or
transform.up = yAxisDirection;
Xerothermic Xenomorph

Ähnliche Antworten wie “2D -Rotationseinheit”

Fragen ähnlich wie “2D -Rotationseinheit”

Weitere verwandte Antworten zu “2D -Rotationseinheit” auf C#

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen