error CS1061:'PlayerInput.OnFootActions' does not contain a definition for 'movement'.

I am currently learning from a tutorial guide from Natty Creations about how to create an FPS game. Tutorial link:

I wrote a script to allow motion controls on my game. An error showed up after I completed the code.

The code is here:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
    private PlayerInput playerInput;
    private PlayerInput.OnFootActions onFoot;

    private PlayerMotor motor;
    // Start is called before the first frame update
    void Awake()
    {
        playerInput = new PlayerInput();
        onFoot = playerInput.OnFoot;
        motor = GetComponent<PlayerMotor>();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
       // tell the playermotor to move using the value from our movement action.
       motor.ProcessMove(onFoot.movement.ReadValue<Vector2>());
    }
   
    private void OnEnable()
    {
        onFoot.Enable();
    }

    private void OnDisable()
    {
        onFoot.Disable();
    }
}

I am a beginner on Unity so I don’t know really a lot about Unity error codes. Thank you.

Then you probably made a typo and you can fix that all by yourself. Here’s how:

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

Tutorials and example code are great, but keep this in mind to maximize your success and minimize your frustration:

How to do tutorials properly, two (2) simple steps to success:

Tutorials are a GREAT idea. Tutorials should be used this way:

Step 1. Follow the tutorial and do every single step of the tutorial 100% precisely the way it is shown. Even the slightest deviation (even a single character!) generally ends in disaster. That’s how software engineering works. Every step must be taken, every single letter must be spelled, capitalized, punctuated and spaced (or not spaced) properly, literally NOTHING can be omitted or skipped.

Fortunately this is the easiest part to get right: Be a robot. Don’t make any mistakes.
BE PERFECT IN EVERYTHING YOU DO HERE!!

If you get any errors, learn how to read the error code and fix your error. Google is your friend here. Do NOT continue until you fix your error. Your error will probably be somewhere near the parenthesis numbers (line and character position) in the file. It is almost CERTAINLY your typo causing the error, so look again and fix it.

Step 2. Go back and work through every part of the tutorial again, and this time explain it to your doggie. See how I am doing that in my avatar picture? If you have no dog, explain it to your house plant. If you are unable to explain any part of it, STOP. DO NOT PROCEED. Now go learn how that part works. Read the documentation on the functions involved. Go back to the tutorial and try to figure out WHY they did that. This is the part that takes a LOT of time when you are new. It might take days or weeks to work through a single 5-minute tutorial. Stick with it. You will learn.

Step 2 is the part everybody seems to miss. Without Step 2 you are simply a code-typing monkey and outside of the specific tutorial you did, you will be completely lost. If you want to learn, you MUST do Step 2.

Of course, all this presupposes no errors in the tutorial. For certain tutorial makers (like Unity, Brackeys, Imphenzia, Sebastian Lague) this is usually the case. For some other less-well-known content creators, this is less true. Read the comments on the video: did anyone have issues like you did? If there’s an error, you will NEVER be the first guy to find it.

Beyond that, Step 3, 4, 5 and 6 become easy because you already understand!

Finally, when you have errors… start at the top of this post!

The video shows Movement, not movement.

Did you find a solution? I have the same problem. (And I spelled “Movement” correctly.) I did the script over again and folllowed the tutorial exactly, but I still get error cs1061.

Show your code then, with the exact error message.

Thankful for help
Here is the code:
```csharp
**using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
private PlayerInput playerInput;
private PlayerInput.OnFootActions onFoot;

private PlayerMotor motor;
// Start is called before the first frame update
void Awake()
{
    playerInput = new PlayerInput();
    onFoot = playerInput.OnFoot;
    motor = GetComponent<PlayerMotor>();
}

// Update is called once per frame
void FixedUpdate()
{
    motor.ProcessMove(onFoot.Movement.ReadValue<Vector2>());
}

private void OnEnable()
{
    onFoot.Enable();
}

private void OnDisable()
{
    onFoot.Disable();
}

}**
```
Here is the error:

Assets\Scrips\InputManager.cs(22,34): error CS1061: ‘PlayerInput.OnFootActions’ does not contain a definition for ‘Movement’ and no accessible extension method ‘Movement’ accepting a first argument of type ‘PlayerInput.OnFootActions’ could be found (are you missing a using directive or an assembly reference?)

What part do you not understand? It’s telling you that “onFoot” which is “PlayerInput.OnFootActions” doesn’t contain “Movement”. So that’s it, it doesn’t have that.

Please forgive my ignorance of the new input system but who defines “OnFootActions” and “Movement”? Is that in the tutorial somewhere? I presume it’s not part of the new input system?

I am a beginner and I follow this tutorial:
https://www.youtube.com/watch?v=rJqP5EesxLk

I do exactly what he does. That’s why I get confused about the error.

I’m going to guess you didn’t. This sounds just like a typo to me. Go back and make sure it isn’t.

If you are convinced you typed it correctly, then throw this tutorial away, it is defective. (I HIGHLY doubt this is the case!)

Otherwise, how to do tutorials properly, two (2) simple steps to success:

Tutorials and example code are great, but keep this in mind to maximize your success and minimize your frustration:

Step 1. Follow the tutorial and do every single step of the tutorial 100% precisely the way it is shown. Even the slightest deviation (even a single character!) generally ends in disaster. That’s how software engineering works. Every step must be taken, every single letter must be spelled, capitalized, punctuated and spaced (or not spaced) properly, literally NOTHING can be omitted or skipped.
Fortunately this is the easiest part to get right: Be a robot. Don’t make any mistakes.
BE PERFECT IN EVERYTHING YOU DO HERE!!

If you get any errors, learn how to read the error code and fix your error. Google is your friend here. Do NOT continue until you fix your error. Your error will probably be somewhere near the parenthesis numbers (line and character position) in the file. It is almost CERTAINLY your typo causing the error, so look again and fix it.

Step 2. Go back and work through every part of the tutorial again, and this time explain it to your doggie. See how I am doing that in my avatar picture? If you have no dog, explain it to your house plant. If you are unable to explain any part of it, STOP. DO NOT PROCEED. Now go learn how that part works. Read the documentation on the functions involved. Go back to the tutorial and try to figure out WHY they did that. This is the part that takes a LOT of time when you are new. It might take days or weeks to work through a single 5-minute tutorial. Stick with it. You will learn.

Step 2 is the part everybody seems to miss. Without Step 2 you are simply a code-typing monkey and outside of the specific tutorial you did, you will be completely lost. If you want to learn, you MUST do Step 2.

Of course, all this presupposes no errors in the tutorial. For certain tutorial makers (like Unity, Brackeys, Imphenzia, Sebastian Lague) this is usually the case. For some other less-well-known content creators, this is less true. Read the comments on the video: did anyone have issues like you did? If there’s an error, you will NEVER be the first guy to find it.

Beyond that, Step 3, 4, 5 and 6 become easy because you already understand!

Finally, when you have errors…

Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

I did as you said. For step 2 I explained it to my cat since I don’t have a dog. Still it doesn’t work. Thank you for your help anyway. Anyone else out there who has a solution?

The solution is to understand what the error is and that the “Movement” doesn’t exist.

At 3.32 in the video, the tutorial creates this “Movement” action on the “OnFoot” actionmap. I guess you got that wrong or spelled it differently (etc). Nobody can give you a “solution”, you need to check out what you’ve done there.

Show us you input system screenshots. The screens where you set up the OnFoot and the actions in the PlayerInput.

Thank you very much! You found the problem and the exact spot in the tutorial. I am very thankful!

I have the same problem but i couldn`t solve it the way you said

Extremely unlikely. Please don’t necro-post to old threads. It’s against forum rules.

Since you have posted absolutely nothing about your problem except your own simple assessment that it is “the same” and yet “couldn’t solve it,” allow me to offer you a better strategy for technical success:

First, always remember nobody can read your mind. NOBODY!

Second, don’t necro post.

Third, use this template, IN A NEW POST, to properly describe your issue:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

If you had read all of the above posts, you would have learned how to solve your problem, and that you shouldn’t have posted this here in the first place, as necroing is against the rules. Kurt-Dekker posted a thorough step-by-step process you can use to solve pretty much every problem you will run into, including this one.

ok

The “Movement” comes from hierarchy folder created inside the “Input Actions” element. Movement(Parent folder) WASD(child) and Jump(child).

hi Ifound the Problem

replace with this code

private PlayerInputs.OnFootActions onFoot;

i also need help for the OnFoot error but i am not quite sure of what to do because i dont really understand the solutions