- Home /
Make An Object, Pivot towards another Object
Hi All. I'm setting up some vehicle physics, Everything is going great except I need to make the wheels Axel follow the Wheel. This is a picture hopefully giving more information on what i want.
So "This Object" is the Wheels Axel / Suspension, I need it to rotate on its Z Axis To follow the wheels Y Axis. I have tryed.
gameObject.transform.rotation.z = target.localPosition.y;
This causes issues with it following too low / high, So i created a var
var minus : float;
gameObject.transform.rotation.z = -target.localPosition.y -minus;
This fixes the issue with low / high, But it still doesn't work, When i turn the axis are like flipped & Screws it up completely, I'm hoping someone on this wonderfull forum, Could give me some friendly advice / Point in the right direction To Get this working correctly, Thanks for your time.
Your answer
![](https://koobas.hobune.stream/wayback/20220613121414im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Simple LookAt Rotation with offset pivot 2 Answers
Rotating enemy object to face the player when moving 2 Answers
GUI Element pointing toward object in world 1 Answer
Mobile rotation on pivot 2 Answers
Minimap arrows 0 Answers