- Home /
Mesh does not rotate around custom Pivot
I've a wheel (mesh) in my vehicle, i wanna rotate this around the customisted pivot (created in C4d). but this doesnt work, it always takes the World-Y-Axis, but why? i've changed the mode from global to pivot...
here's my code:
oldSteerAngle = nowSteerAngle;
nowSteerAngle = Input.GetAxis("Horizontal");
differenzSteerAngle = nowSteerAngle - oldSteerAngle;
differenzSteerAngle *= 10;
Lenkrad.transform.RotateAround(Vector3.up, differenzSteerAngle);
Just out of curiosity, where do you live? Germany, Austria or Switzerland? ;)
yes, otherwise my variable name woudnt be "differenz.."
Answer by Bunny83 · Sep 15, 2012 at 01:06 AM
Have you read Transform.RotateAround before you used it? ;) The first parameter is a position in worlspace you want to rotate around. The second parameter is the axis-vector you want to rotate around and the last parameter is the angle in degree.
btw the pivot-mode in the editor only influences the editor handles. It doesn't change some kind of global setting for your project. It has no influence on how your scripts work.
ok, sounds not very bad. but when i set the vector's X/Y/Z, it takes the world coordinates, and not the local, and it has to be rotated 35°, how to get that? otherwise it wouldnt make very much sense to use it in my situation
Your answer
![](https://koobas.hobune.stream/wayback/20220613081044im_/https://answers.unity.com/themes/thub/images/avi.jpg)