Rotate Between Two Angles - Unity Tutorial Basics

Publicado el: 29 noviembre 2020
en el 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);
}
}


En esta página del sitio puede ver el video en línea Rotate Between Two Angles - Unity Tutorial Basics de Duración hora minuto segunda en buena calidad , que subió el usuario Little Arch Games 29 noviembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 9,643 veces y le gustó 159 a los espectadores. Disfruta viendo!