how can this code run? passed 3 arguments in transform.Rotate 's constructor

Hi friends,
I am a beginner to both Unity Scripting and unity Community.
This question may be ameture but please answer if you can help

I am learning unity scripting and at present on beginning.
the tutor had wrote a script as follows-

this.transform.Rotate (new Vector3 (1f, 1f, 1f), 40 * Time.deltaTime, Space.Self);

but I am bit confused that how is it possible because when we go through the documentation of “transform.Rotate” then it says as about the constructors:-
public void Rotate(Vector3 eulerAngles, Space relativeTo = Space.Self);
public void Rotate(Vector3 eulerAngles, Space relativeTo = Space.Self);

as you can see tat we can add only 2 arguments that are Vector 3 object and Space.
You can even check it at this link Unity - Scripting API: Transform.Rotate

and as I had mentioned above that the instructor had added three arguments:-

  1. new Vector3 (1f, 1f, 1f)
  2. 40 * Time.deltaTime
  3. Space.Self
    And the line of code is working and giving a bit different type of rotation so it is just making me curious to know about what had happened.
    Please help .

Look at all of the constructors in the docs, not just the first one.

–Eric

1 Like

can you please tell me that how this code is working because it isn’t simple x,y,z axis rotation as far as I know because when you check it out on a cube then it looks something different from simple x,y,z axis rotation.

Scroll down the page to the second overload of that method
public void Rotate(Vector3 axis, float angle, Space relativeTo = Space.Self);

Got it.
Thanks a lot KelsoMRK