Keep ArcRotateCamera current rotation as it follows a mesh around?

Hello, I am currently making a solar system simulator, and my camera is currently following a planet as it orbits around the sun. The problem I am having is that as the planet orbits around the sun, the camera is targeting the planet and constantly looking at it, but the “position” of the camera is rotating as the planet is moving into/away from the camera position. Is there a way to fix the rotation of the camera while still having the functionality of changing the camera angle with your mouse/keyboard? Here is an example of what is happening: ArcRotationCamera - Streamable

1 Like

Hey Zydico!

I know there are multiple ways of attaching the camera to something and one way does the panning.
The target of the camera is the point it looks on.
If you set the target directly to the position of the object you are looking on then it should move without panning.

See this Playground example

Does this work for you? How did you do the moving until now? I forgot what to do to get the panning :sweat_smile:

Thank you for the reply. I looked at my code again and realized that the problem was that I wasn’t setting it to the position property, but instead I was creating a new vector with the same x y and z values.

1 Like