Rotating Models in Unity

Ok i am new to Unity so this may seem like a stupid question:

I have bought some fbx models with whicj i attend to make a 2D game. To be able to use hte models the way i want, i have to rotate them 270 deg in the x-axis. From that i point on during the game i want the model to rotate in the z-axis to simulate a steering movement. But when I do it (I use : gameObject.transform.Rotate(0,0,-Time.deltaTime*radialVelocity, Space.World), the effect i get is not what i want. When i rotate the fbx either from the iterface or using code w.r.t it self i get even stranger results. Basically my question is that after i rotate the model in the x-axis how to i make rotate on its z-axis without causing it to rotate in any other axes.

2 Answers

2

Want to rotate the model in the Z axis?

var rotateSpeed = 25.0;

transform.eulerAngles.z += rotateSpeed * Time.deltaTime;

I am sorry that my question did not aid you, and I really have no clue how I can further help you besides telling you that it sounds like your x,y and z axis is messed up.

–

in your 3d modelling software you need to alter the pivot point of the object BEFORE you animate and/or import it into unity. I've had the exact same problems, seen it loads of times, and loads of people have asked this same question, next time try looking for the answer via google or the archives of this site instead of polluting it with already overly asked questions.