Why is rotation offset

If i use this code

transform.position= Vector3.zero+Vector3(0,0,1);

Now In the inspector I rotate the y value and the obejct has its own axis.

If I use this

transform.position= Vector3.zero+transform.TransformDirection(0,0,1);

Now In the inspector I rotate the y value and the obejct rotates on the Vector3.zero Axis as it would be parented on the first Vector. In this case vector3.zero

Why is this?? Its Possible to use :

transform.position= Vector3.zero+transform.TransformDirection(0,0,1);

BUT TO USE THE OWN OBJECT AXIS ???

Hi Psyhova,

There are many options with how to alter transform (position, scale, rotation).

One option is to treat movement and rotation separately like this.

transform.position = new Vector3 
(
          transform.position.x + 10, 
          transform.position.y, 
          transform.position.z
);
transform.Rotate(new Vector3( 1, 2, 3), 45, Space.World);

Enjoy!

-Sam