[Solved] Problem with rotation script using Unity Script
The script line below is supposed to rotate my object but instead it rotates only the handles of the objects. Any idea why it does this and thanks for any help in advance.
piece.transform.Rotate(Vector3(0, 0, rot));
P.S. I have tried a lot of different ways to rotate the object all of them gives the same problem.
piece.transform.Rotate(Vector3(0, 0, rot));
P.S. I have tried a lot of different ways to rotate the object all of them gives the same problem.
Comments
function Update()
{
transform.RotateAround(transform.position, transform.up, Time.deltaTime * 90f);
}
The 2 versions of the script below works but again it rotates the wrong way, for some reason only rotation around the z axis doesn't want to play along.
piece.transform.Rotate(Vector3(0, rot, 0));
piece.transform.Rotate(Vector3(rot, 0, 0));
Have you tried just putting the script on a primitive?
Snapshot of the hierarchy for the object - sometimes, having the script on the wrong child can cause funny issues.
Snapshot of the object properties (the one with the script) - there could be other behaviours that interferes with the rotation. For example, if you have a rigidbody attached that freezes some of the axis the you could experience this behaviour.