Help with rotating of a object

Hi guys,
I am a beginner and i am trying to understand unity scripting a little better(i know how to program but i am not familliar with the functions,how unity works,etc)

So i went on and make a cube in my favorite 3d modeling program and made a Jscript that rotates an object and i took a bit from the script reference and added my own :

// Slowly rotate the object around its X axis at 1 degree/second.

    transform.Rotate(Vector3.right*25 * Time.deltaTime);



    // ... at the same time as spinning relative to the global 

    // Y axis at the same speed.

    transform.Rotate(Vector3.up*25 * Time.deltaTime, Space.World);

But i have 2 questions :

1.How do i rotate the X alone because right now i am using Left to rotate to the x axis, is there a way to axis the vector and rotate it like transform.Rotate(Vector3(x,y,z),etc,etc) ?

2.I noticed that my cube isn’t rotating around its own axis/origin, how do i edit the axis/orgin so i can let the cube rotate around its own orb?

Thanks in advanced.

1:transform.Rotate(x, 0, 0);

2:Its supposed to automatically rotate on its local axis, if it doesn’t though, use a fourth parameter like so: transform.Rotate(x, 0, 0, Space.Self )

Of course, this information is all available on the unity scripting reference here: link

Thank you sir, i am reading the scripting reference but sometimes i get confused on a few little details.

Fair enough. I hope you get done what you want to get done :smile:.