- Home /
Object fly around another?
I have a sphere and i want another sphere to fly around that one(looped). Its a 2d game so it should fly around on one axis(so the flying sphere can be seen all the time). I bet you could accomplish this effect with iTween, but my knowledge about iTween is not good enough to do so.
Could someone help me with that problem? (A solution without iTween would be even better, cause iTween is giving me a bunch of error msgs!)
Celofa
Answer by Jesse Anders · Jan 20, 2011 at 11:20 PM
I'm sure you could get an iTween-based solution to work, but doing it 'manually' should be fairly straightforward as well. Here's one possible solution:
Create a game object and make it a child of the object that is to be 'orbited around'.
Add a script to that object that rotates the object in the way you want (e.g. by modifying Transform.localEulerAngles).
Add another game object as a child of the 'rotating' game object (this will be the 'orbiting' object).
Position the orbiting object relative to the rotating game object to create an orbiting effect.
Your answer
![](https://koobas.hobune.stream/wayback/20220613100338im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
rapid movement back and forth 1 Answer
Player on moving object doesn't follow it Unity 5 0 Answers
how to align particle systems to an objects orientation as it moves? 2 Answers
How to stop a moving object 2 Answers
Dragging Objects with the mouse 1 Answer