Nickk888SAMP / RTSCameraController-Cinemachine

A RTS style Camera Controller for Unity 3D's Cinemachine system.
GNU General Public License v3.0
93 stars 12 forks source link
camera cinemachine rts-game unity3d

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

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