Slowly Rotate Toward a Target

Veröffentlicht am: 29 März 2019
auf dem Kanal: Omar Santiago
20,586
456

In Unity, you can use LookAt() to directly aim at a target... but what if you want to slowly rotate (or turn) toward a target object in a game? In this unity tutorial we will find out how to slowly turn one gameobject to point at another game object.

Examples of how to use a rotation like this are for a camera to follow an object, a cannon to rotate toward a target, and more...

Quaternion rotTarget = Quaternion.LookRotation(FollowObject.position - this.transform.position);

this.transform.rotation = Quaternion.RotateTowards(this.transform.rotation, rotTarget, Speed * Time.deltaTime);


Omarvision game programming tutorials, unity game engine. http://www.omarvision.com. Free classes at Microsoft Store - International Plaza 2223 N. West Shore Blvd, Tampa FL 33607


Auf dieser Seite können Sie das Online-Video Slowly Rotate Toward a Target mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Omar Santiago 29 März 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 20,586 Mal angesehen und es wurde von 456 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!