- Home /
getting a object to slowly orbit
How do I get the camera to slowly orbit game objects. I tried creating a empty GameObject making it the parent of the camera and rotating the empty gameobject but this didn't work and it doesn't sound like the best way to do it. how else could this be done?
Answer by robertbu · Jul 20, 2013 at 05:41 PM
You can use Transform.RotateAround(). Be sure to use the documented version of this function (an undocumented version also comes up when typing in Mono). Be sure the object starts out perpendicular to the axis you choose to rotate around.
Your solution of using an empty game object and a parent/child relationship is just fine. Without the source and a better description of the setup, we cannot help you fix it.
Answer by IgorAherne · Jul 20, 2013 at 04:55 PM
It's actually a pretty clever way.
Just make sure that the empty gameObject has its transform.position set equal to the transform.position of the object orbited around.
Don't forget to delete the empty game object after that.
If your camera is already a child, and you are worried about breaking a link, I would still detach it. After that - orbit around the empty GameObject, delete it, move camera to starting position and link it back to the old parent.
Your answer
Follow this Question
Related Questions
Mouse click on a game object to animate the main camera. 0 Answers
Using the accelerometer to rotate Camera 1 Answer
GUI controlling other game objects 0 Answers
Is there a way (or an asset) to make the Cinmachine cutscene camera move more naturally? 0 Answers
How can I fix the touch orbit rotation? 0 Answers