Thanks for your interest in my Orbit Camera, the first of a series of projects designed to help you create your own space flight simulation games. This page contains a breakdown of the Blueprint Content found in the project to help you pull it apart and adapt it for your own needs.
All of the logic for the Orbit Camera is contained within this Pawn, and you can drop it into your scene to immediately start fine-tuning its settings. The Blueprint comes with a very simple camera rig (mostly just a spring arm) and a demo rocket model based on the one found in Epic’s Content Examples project.
The Pawn also comes with a dynamic SkySphere (well, SpaceSphere) that has a nebula panorama material applied. This is mostly to help illustrate camera movement for the demo, but I must admit it was a lot of fun to make.
To make things as easy to understand as possible I’ve subdivided the behaviour of the Orbit Camera into 4 distinct modes. Based on your input the camera will intuitively switch between these modes.
My apologies to camera operators worldwide, as I very much doubt I’m using these terms correctly!
Add Camera Input
Calculates camera input for the current frame based on your aspect ratio. It also clamps this value to make sure we can’t spin the camera at the speed of light.
Update Camera Lag
Slowly interpolates Camera Input (which is the combined total of the current user input plus residual camera motion from the previous frame) down to zero based on the Camera Mode. This allows for different lag settings for each mode.
Rotates the camera based on a 2D speed input. The Use Spring Arm boolean value determines whether or not this rotation happens at the camera’s origin or the actor’s.
Sets the desired Dolly Distance.
Sets the desired Zoom Distance.
|Camera Input Max||The combined total of both current and previous camera input cannot exceed this value. Useful if we don’t want camera rotation speed to build up too much!|
|Camera Input Rotation Lag||How much we smooth out the motion of the camera rotation. The lower the value, the more lag there will be. This is similar to the Spring Arm component’s ‘Camera Lag’ feature, which we’re not using because it’s a bit too limited for our purposes.|
|Camera Input Translation Lag||The same as Camera Rotation Lag, but for Dolly and Zoom modes only.|
|Orbit Speed||How fast the camera will orbit around your object.|
|Orbit Pitch Min||Minimum camera pitch while in Orbit mode.|
|Orbit Pitch Max||Maximum camera pitch while in Orbit mode.|
|Pan Speed||How fast the camera will rotate while in Panning Mode.|
|Pan Pitch Min||Minimum camera pitch while in Panning mode.|
|Pan Pitch Max||Maximum camera pitch while in Panning mode.|
|Pan Return Delay||How long the camera will pause before returning back to its usual position when no longer in Panning Mode.|
|Pan Return Speed||How fast the camera will return back to its original position when no longer in Panning Mode.|
|Zoom Speed||How fast the camera’s field of view will move.|
|Zoom Return Delay||How long the camera will pause before returning back to its usual position when no longer in Zooming Mode.|
|Zoom Return Speed||How fast the camera will return back to its original position when no longer in Zooming Mode.|
|Zoom Distance Default||Default field of view.|
|Zoom Distance Min||Minimum field of view.|
|Zoom Distance Max||Maximum field of view.|
|Zoom Lag||How much input smoothing there is when in Zoom Mode.|
|Zoom Interval||How much the camera will zoom in when the mouse wheel is scrolled.|
|Zoom Interval Lag||The smoothing of the animation while using the mouse wheel to zoom the camera.|
|Dolly Speed||The speed at which the camera will move in Dolly Mode.|
|Dolly Distance Default||The camera’s default distance from the origin of the rocket.|
|Dolly Distance Min||The closest distance at which the player can push the camera in towards the rocket.|
|Dolly Distance Max||The maximum distance the camera can be from the rocket. Also used to calculate the maximum size of the SpaceSphere.|
|Dolly Lag||How much input smoothing there is when in Dolly Mode.|
|Dolly Interval||The distance the camera will move when the mouse wheel is scrolled when in Orbit Mode. This value is a percentage of the current Spring Arm length, getting incrementally larger the more you pull out.|
|Dolly Interval Lag||Movement lag while using the mouse wheel to dolly the camera.|
Frequently Asked Questions
Will this work for things other than spaceships?
Of course it does! I just couldn’t think of anything cooler than a rocket ship to demo the Orbit Camera’s features.
Changing the object that the camera orbits around is as easy as swapping out the Static Mesh. You can add your own components in whatever configuration you wish, the Camera doesn’t need to communicate with any of them.
If your object of interest isn’t in outer space or underwater you might want to set your Orbit Min Pitch value to something closer to 0 or you might punch through the ground.
How can I make the camera collide with my scene?
Space is pretty empty so I didn’t bother with camera collision, but this is something the Spring Arm component can do by default. All you need to do is check the Do Collision Checks box and set the Probe Size to whatever is appropriate for your scene.
Now when the camera collides with something (or line of sight is broken) it will push in to avoid intersections.