I have been trying to spin my imported wheel from blender 360* but when I do it, it doesn't rotate on the center (on one spot). I'm using C#.
I have tried this:
transform.Rotate(Vector3.forward, 5f - 90);
But this doesn't spin on one spot.
I have been trying to spin my imported wheel from blender 360* but when I do it, it doesn't rotate on the center (on one spot). I'm using C#.
I have tried this:
transform.Rotate(Vector3.forward, 5f - 90);
But this doesn't spin on one spot.
That is probably because your model's origin isn't in its center. You need to either
or
RotateAround
which you can then for an example pass in collider.bounds.center
to rotate around your collider's center position.RotateAround
allows you to define the point to rotate around. Pass in the center point of your mesh or collider. Google will help you how to access those values.
\$\endgroup\$
– Tyyppi_77
Oct 30 '16 at 16:43