Rotate Between Two Angles - Unity Tutorial Basics

Publicado em: 29 Novembro 2020
no canal de: Little Arch Games
9,643
159

Basic tutorial on rotating a gameobject between two angles in Unity. This is the easiest way I've found to rotate a game object between two angles back and fourth. There might be better ways to do this for your project but I find this way works for me. You can also serialize a field for the angle to move between and the starting angles so they are configurable in the inspector.


If you liked this, check out my game Escapea available on Android and iOS.
Android - https://play.google.com/store/apps/de...
iOS - https://apps.apple.com/us/app/escapea...


Thanks for Watching!


Script:


{
[SerializeField] float rotateSpeed = 60f;

void Update()
{
transform.localEulerAngles = new Vector3(0, 0, Mathf.PingPong(Time.time * rotateSpeed, 180) - 45);
}
}


Nesta página do site você pode assistir ao vídeo on-line Rotate Between Two Angles - Unity Tutorial Basics duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Little Arch Games 29 Novembro 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 9,643 vezes e gostou 159 espectadores. Boa visualização!