Thanks a ton. Just in time when i was searching insanely for it.
A suggestion: change the title to Freelook Cinemachine so that it can pop up more on search engine.
sorry to bump but this also works for Cinemachine and unitys new input system.
take the delta from the mouse and then split the vector2 into .x and .y and then just return it
Thank you! This works with controller input systems (like InControl). Works with Free Camera and Virtual Camera too. I’m using it for POV controller input.
This thread is now quite old, and Cinemachine has built-in features to do many of the things that you would need this script for. What are you trying to accomplish?
what is the best solution to code both mouse and game pad input axis with bolt? i can only use bolt. i tried C# for 6 months. I use bolt only now.
i need to control input axis string name with bolt into cinemachine. or i want to use new input manager but it is too hard and i broke my whole game last time i tried it. can it work with bolt???
Thanks, Greg. As far as I can tell, I can only input one axis string name per free look axis. I would like TWO on each simultaneously. mouse and right analog stick.
As I understand, I am to leave the axis field BLANK which allows me to code as many as I want. What I’m having trouble finding is what code to use to do such an operation, (and then of course translate that to bolt, if indeed i can.)
The easiest way is to make a custom script that inherits AxisState.IInputAxisProvider (see Interface AxisState.IInputAxisProvider | Cinemachine | 2.6.17). Add that custom script to your vcam. The vcam will find it and ask the script whenever it needs an input value. Your script’s implementation of GetAxisValue() will query whatever input source you care about, and return the result.
Unfortunately I can’t help you with Bolt, I have never used it.
@Gregoryl
My apologies if I am bothering. Using InputAxisProvider to use cinemachine with the new input works wonderfully but, here’s is where I am stuck: when you add a touchscreen bind inside a Looks action (default input map when creating player input) this will aloud to control cinemachine on mobile when you touch the screen, but if you have a image / joystick with the on-stick script for the new input system also on mobile both input will cross; while moving the player with the joystick the camera also moves.
Do you have any tips in how to use both input without crossing each other?