Unity Cinemachine cant GetAxisValue CS1061

143 Views Asked by At

Beginner here trying to follow a tutorial on youtube but two scripts wont reference correctly and keep getting error CS1061 on code snippet GetAxisValue.

https://www.youtube.com/watch?v=PsAbHoB85hM&t=589s

here are two code snippets

Part of PanZoom.cs script

 float x = inputProvider.GetAxisValue(0);
 float y = inputProvider.GetAxisValue(1);
 float z = inputProvider.GetAxisValue(2);
 if (x != 0 || y != 0)
    {
        PanScreen(x, y);
    }

And this is what im trying to access in CinemachineInputProvider.cs

public virtual float GetAxisValue(int axis)
    {
        var action = ResolveForPlayer(axis, axis == 2 ? ZAxis : XYAxis);
        if (action != null)
        {
            switch (axis)
            {
                case 0: return action.ReadValue<Vector2>().x;
                case 1: return action.ReadValue<Vector2>().y;
                case 2: return action.ReadValue<float>();
            }
        }
        return 0;
    }
1

There are 1 best solutions below

1
On

FIXED: Just reinstalled Cinemachine.