Advanced RTS Camera in Unity 6.3 W/ Cinemachine & Input System (2026 Edition)

Опубликовано: 13 Май 2026
на канале: Zeus GameDev Academy
1,674
70

Source Code: https://zeusgamedevacademy.gumroad.co...

In this tutorial, we learn to create an advanced camera system for an RTS, RPG, or management game. This overhead camera is common for a wide variety of games. We'll make it smoothly orbit and zoom in and out (it's technically a dolly but we're calling it zoom for the sake of simplicity), we'll make it stand above the terrain, avoid obstacles, and track objects or a position on the terrain by double clicking somewhere in the world.

This tutorial is for beginners+, or intermediate developers. If you're a complete beginner I highly recommend taking my Unity Crash Course: https://www.udemy.com/course/unity-cs...

The camera in the video is quite smooth, but you can always tweak the values of the parameters to get a more responsive camera, try these parameters:
Keep the acceleration at 100 as opposed to 50 as in the video, higher values will make the camera respond faster to input.
Keep the move speed at around 25-30 to account for the zoom level. A speed of 15 as in the video may result is a very slow camera.
For OrbitScale in CinemachineInputAxisController, keep acceleration time to 0.5 while decelTime can be kept at 1, this again will make the dolly more responsive to input.

----------------------------------------------------------
Errata:
During the editing phase of the video, I removed a whole section by mistake, it was about slowing down the camera when it's fully zoomed in. I implement it using an animation curve named SpeedScaleWithZoomCurve, and in UpdateMovement, I multiply the target velocity by the result of the following method:

float ComputeSpeedScaleWithZoom()
{
float radialAxisValue = orbitalFollow.RadialAxis.Value;
Vector2 radialRange = orbitalFollow.RadialAxis.Range;

float zoomLevel = Mathf.InverseLerp(radialRange.x, radialRange.y, radialAxisValue);

return SpeedScaleWithZoomCurve.Evaluate(zoomLevel);
}



This video is an update on this one that I made almost 11 months ago:    • RTS Camera In Unity 6 (2025 Edition, THIS ...  

In the 2025 version of the video, I show how to control orbit and dolly by code, which is not necessary, also I use the PlayerInput script, which has always been confusing to use for me and my viewers. But it does have a section on edge scrolling which you might find useful, I didn't talk about it here because the video is already 1 hour long, but you can apply the same principles from the old video.

---------------------------
Become an insider and get access to my premium courses:
   / @zeusgamedevacademy  

---------------------------
Assets used in this video, may contain affiliate links (i.e when you purchase something, I make some money with no extra charge to you):

Meadow Environment - Dynamic Nature: https://af.unity.com/ot/vwM34eJ/

Full Screen Editor: https://prf.hn/l/QLBk5Lq/

Hot Reload | Edit Code Without Compiling: https://prf.hn/l/ryqWmVm/

Truck from Desert Ghost Town: https://af.unity.com/ot/BJD1vwJ/

Tower by DJMaesen on Sketchfab.

---------------------------
Timestamps:
00:00:00 Introduction
00:03:09 Creating an Orbit Camera in Unity 6.3
00:10:23 Handling Orbit Input (No Code)
00:19:04 Handling Camera Collisions
00:22:03 Programming the Camera Movement
00:47:46 Following the Ground Height
00:56:56 Getting the Mouse Cursor Position in the World
00:58:34 Tracking a Position When Double Clicking
01:07:16 Tracking a Moving Object
01:10:32 Closing Thoughts and Ideas for Improvements