[Resolved] Issue with Movement in new Unity 2D RPG: Complete Combat System

Hi everyone!

I am currently on the first video within the Player Movement section of the new Unity 2D RPG: Complete Combat System and am experiencing the following error during compilation/runtime:

“‘PlayerControls’ does not contain a definition for ‘Movement’ and no accessible extension method ‘Movement’ accepting a first argument of type ‘PlayerControls’ could be found (are you missing a using directive or an assembly reference?)”

. . . which is referring to the following line in my respective C# player class:
movement = playerControls.Movement.Move.ReadValue();

I’ve created the Player Controls class as the byproduct of importing the new “Input System” package into my project, and creating the new ‘Input Actions’ object. I elected to auto generate the C# class as instructed, and can see in the editor that the C# class name is in fact “PlayerControls” for my Input Action asset.

I also went into the project files in Gitlab and made sure my line of code is identical, in addition to re-booting Unity and the project.

Any guidance or support would be much appreciated!

Ah, fixed it!

I hadn’t renamed the default Action Maps and Actions values so of course those properties didn’t exist. :slight_smile:

1 Like

Indeed, giving the actions names to refer to them in code is kind of at the core of the InputSystem… :grin:

(@Marc_Carlyon This posting caught my attention because it was shown below the other thread of mine as one of “most recently posted” threads, and it’s missing the lesson tag as well.)

1 Like

Thanks, I have added the tag manually.
Incidentally if you are taking the course on our site the tag appears just under the bottom right of the video so if its missing when you post you can use that tag.
The tags exist its just out automated system is not automatically applying them to the posts when clicking on the lecture discussions link.

Again thanks again for the heads up

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms