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.