Home

Awesome

Unity 3D Real Time Strategy/City Builder Camera Controller for Cinemachine Virtual Camera

<img src="/Preview/1.gif" width="400" height="175"><img src="/Preview/2.gif" width="400" height="175"> <img src="/Preview/3.gif" width="400" height="175"><img src="/Preview/6.gif" width="400" height="175"> <img src="/Preview/8.gif" width="400" height="175"><img src="/Preview/7.gif" width="400" height="175"> <img src="/Preview/5.gif" width="400" height="175"><img src="/Preview/4.gif" width="400" height="175">

This project is a Camera Controller for RTS style games, it'll also fit perfectly into a City Builder! It works by adding the script to a Gameobject and placing references for the Virtual Camera and the Target itself. The script controlls the Target and the Virtual Camera. Use ANY Input System using the Input Provider system.

Features

Requirements

Want to use Unity's Input System?

To get the files, unpack RTSCameraController_NewInputSystem.unitypackage that's located in the RTSCameraController directory while in the editor. Use the RTSCameraController_NewInputSystem.prefab instead or just swap the InputProvider_OldInputSystem.cs with InputProvider_NewInputSystem.cs in the RTSCameraController Game Object. Makes sure to install the Input System package from the Package Manager of course.

Create your own input provider script

Just create a new Script and inherit from the IRTSCInputProvider interface and let your code editor automatically populate with all the methods from the IRTSCInputProvider. Return the values (Bool, float or Vector2) to the specific Methods. Place the script alongside the Controller script and that's it. Just make sure there's only one Input Provider placed as a component. You can use the premade Input Providers as a guide.

How To Use

Default Settings:

WASD or Middle Mouse Button - Camera Movement

Right Mouse Button or Q or E - Rotation

Mouse Scroll Wheel - Zoom-In/Zoom-Out

R or F - Height Change

forthebadge