Home > Blockchain >  C# Error CS1061: 'PlayerInput.OnFootActions' does not contain a definition for 'look&
C# Error CS1061: 'PlayerInput.OnFootActions' does not contain a definition for 'look&

Time:01-12

InputManager Code PlayerLook Code

I'm getting an Error telling me that 'PlayerInput.OnFootActions' does not contain a definition for 'look' and no accessible extension method 'look' accepting a first argument of type 'PlayerInput.OnFootActions' could be found.(are you missing a using directive or an assembly reference?). I have no idea why this is happening.

I'm fairly new to coding, so I don't know why this is happening, even though it look fine. Thank you for the help!

I've attempted delete the files and rewriting the code, but to no avail. I kept getting this error.

CodePudding user response:

Does PlayerInput.OnFootAction have a member of type PlayerLook? Knowing zero of what your are doing, it seems that the call

look.processLook(onFoot.look.ReadValue<Vector2>());

has something strange in the part onFoot.look. This is giving you a compilation error.

The compiler is looking for something called look into the type OnFootAction. And that seems visibly wrong.

CodePudding user response:

If you followed the tutorial correctly, then it’s not onFoot.look.ReadValue, it’s supposed to be onFoot.Look.ReadValue. Note the capital ‘L’ in “Look”. I believe it’s the tutorial by Natty Creations. When following tutorials, you need to make sure spelling and capitalisation are observed.

  • Related