Make a translation and a rotation on a spaceship
Hi guys !
I want to do a translation and a rotation on the spaceship of my game so it follow the terrain as you can see below :
For me the best solution would be to make the rotation on the z axe of the ship with the y axe always looking at the transform position of the terrain at the top of the picture.
I don't know how to do it correctly, I already tried some things with the LookAt method but nothing worked so far.
What's the best solution to do it properly ?
Answer by jgodfrey · Jun 05, 2016 at 11:27 PM
I'd probably make the spaceship a child of an empty game object. Place the empty parent object at the actual rotation point (so, the top of the yellow arrow in your image). Then, move the child object (the spaceship) down to the position you show it in your image. Then, when you rotate the empty game object, the spaceship should rotate with it much like a pendulum - which seems to be the effect you're looking for.
Thanks for the answer I was hable to do it with your solution !
Your answer
![](https://koobas.hobune.stream/wayback/20220612082336im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
rotation problem (me lio con rotacion) 1 Answer
How can i rotate an object using LookAt with only 1 axis? 0 Answers
How would I add rotation limits to this? 1 Answer
Rotate an object to look at another object on one axis? 5 Answers
How to object rotate on a single axis towards another object? C# 2 Answers