Help understanding transform.Rotation

Hey there! So I finished Transform.translate() and got everything as it should be. However, I’m trying to understand the ‘how/what’ behind it. What I mean is, the ‘car’ drives in a circle around the center point/camera rather than continuously rotating in circles itself.

What’s the reason/cause behind that?

I’m super new to coding, so I’m trying to get a better understanding and I hope this makes sense. Thanks!

Hi,

Unfortunately, most parts of Unity are not open-source, so we often do not know what is going on behind the scenes. That is also the case here.

Have you already tried to look the Transform.Translate() method up in the API? If not, do that, please. You’ll see that it just moves a game object forward along its local “forward” axis. It does not rotate anything. The Transform.Rotate() method rotates a game object.

In the next sections, Rick and Gary will teach you a variety of techniques how to move a game object in Unity. However, in the end, everything just manipulates the same values in the Transform object. You could manipulate them directly by overriding the position and rotation directly, or you could have Unity do that for you by using Unity’s premade methods like Translate() and Rotate().

If you are wondering why we are using Unity’s methods instead of doing the maths ourselves: We are using a game engine to save us time so we are able to create our games. Time is crucial. In the past, whole teams spent months to create the little games we are able to create alone within a couple of hours thanks to game engines.

What I want to say is: Nowadays, coding is less about understanding every single detail and more about knowing what tools are available and how to use them to solve your problems.

Hopefully, this helped. :slight_smile:


See also:

1 Like

Thank you so much for such a well-written answer. Apologies for the confusion, though, as I don’t think I explained myself well. Though this is good information to know regardless!

I meant I had just finished the section named “Transform.translate” and I had been wondering about why the ‘car’ drives in a circle around the center point (camera) rather than the car itself spinning in circles. But when I moved onto the next section, I see changing the value of “Rotate” affects if the car drives in a circle or if the car spins itself. So I think I kind of see what is happening there.

I still don’t know if I’m making any sense with this, though, but again thank you so much for the reply.

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

Privacy & Terms