how to fix

how to fix

Assets\scripts\PlayerMovement.cs(19,18): error CS1061: ‘PlayerControls’ does not contain a definition for ‘Land’ and no accessible extension method ‘Land’ accepting a first argument of type ‘PlayerControls’ could be found (are you missing a using directive or an assembly reference?)

Heres my script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
PlayerControls controls;
float direction = 0;

public float speed = 400;

public Rigidbody2D playerRB;

private void Awake()
{
    controls = new PlayerControls();
    controls.Enable();

    controls.Land.Move.performed += ctx =>
    {
        direction = ctx.ReadValue<float>();
    };
}


// Update is called once per frame
void Update()
{
    playerRB.velocity = new Vector2(direction * speed * Time.deltaTime, playerRB.velocity.y);
}

}
,this is my code using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
PlayerControls controls;
float direction = 0;

public float speed = 400;

public Rigidbody2D playerRB;

private void Awake()
{
    controls = new PlayerControls();
    controls.Enable();

    controls.Land.Move.performed += ctx =>
    {
        direction = ctx.ReadValue<float>();
    };
}


// Update is called once per frame
void Update()
{
    playerRB.velocity = new Vector2(direction * speed * Time.deltaTime, playerRB.velocity.y);
}

}

The error message is telling you that the ‘PlayerControls’ class does not have a member called ‘Land’. It looks like you are trying to access a member called ‘Move’ on an object called ‘Land’ within the ‘PlayerControls’ class.

This error could be caused by a few things:

The ‘Land’ object and ‘Move’ member do not exist in the ‘PlayerControls’ class.

The ‘PlayerControls’ class is not properly imported or referenced in the script.

The ‘PlayerControls’ class is not implemented or created by you.

To fix the issue, you should check if the ‘Land’ object and ‘Move’ member exist in the ‘PlayerControls’ class, and if they do not, you should either create them or use the correct member/object.

Also, check if you have the proper import statement or assembly reference for the ‘PlayerControls’ class.
If the issue is that you don’t have the ‘PlayerControls’ class, you’ll need t