When to use transform.rotate and when transform.rotation?

Hi all! I’m doing the Argon Assault challenge and Ben is explaining how to use transform.rotation for the spaceship yaw, pitch and roll.

I remember that we used transform.rotate in Project Boost, so I’m wondering, when should you use one and when should you use the other?

Hi Oliver,

Ben and Rick want to teach a variety of techniques because in many cases, there are multiple ways to make something work in Unity.

Use the Rotate method if you want to rotate an object but do not need to clamp the rotation.

Use transform.rotate if you want to control the rotation values, for example, if you want your ship to have a specific rotation at a specific position.

thank you Nina!

So if I wanted to apply rotation momentum on a certain axis, then transform.rotate could be a viable option, right?

Exactly. There are even more methods like Quaternion.RotateTowards and many more methods. Since most of Unity is not open source, we often do not know what exactly they do and where the difference between them is.

For this reason, I would say to test different methods and approaches to find the one which you feel solves your problem best. :slight_smile:

1 Like

Thank you Nina for your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms