The following code provides this error : Assets\Game\Scripts\Move2d.cs(11,22): error CS0246: The type or namespace name ‘InputAction’ could not be found (are you missing a using directive or an assembly reference?)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Move2d : MonoBehaviour
{
private Rigidbody2D _rigidbody2D;
public float m_speed = 1.0f;
private Vector2 _userinput;
public void Move(InputAction.CallbackContext context)
{
_userinput = context.ReadValue();
}
void Start()
{
_rigidbody2D = GetComponent();
}
void FixedUpdate()
{
_rigidbody2D.MovePosition(_rigidbody2D.position + _userinput * Time.fixedDeltaTime * m_speed);
}
}
I haven’t any idea why I can’t use InputAction , I even tried the all powerful ChatGPT but got nowhere.