Cinemachine Freelook Input

Hello there,

I am using Cinemachine to make camera for an mmo style game. I have the Freelook camera implemented and it is working quite well. Im just wondering if there is a simple way to only rotate this camera when a mouse button is clicked instead of it always rotating whenever you use the mouse. I am looking to have a similar type of camera to World of Warcraft for example. So if leftclick is held down the camera will rotate around like it does right now and if no mouse buttons are clicked the camera wont rotate, so the cursor can be used to interact with objects without rotating the camera.

Any thoughts would be greatly appreciated. I have thought of making another script that inherits from the freelook camera so i can add this functionality or disabling the inputmanager axis but I feel like there has to be a simpler solution with this complex of a camera.

This is not a support forum and it says it below the description for the forum.

You should post this in Unity Engine - Unity Discussions seeing as that is the cinemachine section, as people are unlikely to offer much help if any here (in general discussion which is for - general discussion)

Yes, posting on the Cinemachine forum is a good idea in general, but this time I can help you here.

Don’t use inheritance. Instead, use Cinemachine’s InputProvider API to add an input provider script to the FreeLook. Your custom provider’s GetAxisValue() implementation could return nonzero input only when the mouse button is pressed.

https://docs.unity3d.com/Packages/com.unity.cinemachine@2.7/manual/CinemachineAlternativeInput.html

2 Likes

ok sorry for misposting. and thank you for the link