Orbital Camera Similar To Kerbal Space Program

I’m making a space-simulator-style game, but I can not find a good script to control the camera with the mouse.

I’ve already looked for “3rd person camera” and “orbital camera”, but they all seem to have a rotation limit. I also need the camera to run next to the rocket.

This was the closest I’ve found so far: https://raw.githubusercontent.com/makoto-unity/JaxaApiUnity/master/Assets/Scripts/MouseOrbitImproved.cs

You can just make your own one with out a rotation limit (or modify one of the existing ones you have) with transform.RotateAround.

my hunch tells me you’re very new to this, if that’s the case you shouldn’t be attempting anything like ksp in either scale or complexity until you get the basics.

what does that mean?

This means that the camera stays aligned to some axis of the rocket

Then parent the camera to the rocket, it will translate with it keeping the same offset.

I strongly suggest learn to use quaternions.
While parenting can work and be simple to execute, for any 3D game, using quaternions is nearly inevetable.
Specially when involving full gimbal 3D orientations.

1 Like