I keep getting the error 'The type or namespace 'MovementValue' could not be found - are you missing a using directive or an assembly reference' with the following code:
Would anybody be able to give me a helping hand as to what I am doing wrong (this is my first ever C# script)?
I would be so grateful!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class playercontroller : MonoBehaviour
{
private Rigidbody rb;
private float movementX;
private float movementY;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void OnMove(InputValue movementValue)
{
Vector2 movementValue = movementValue.Get<Vector2>();
movementX = movementVector.X;
movementY = movementVector.Y;
}
void FixedUpdate()
{
Vector3 movement = new Vector3(movementX, 0.0f, movementY);
rb.AddForce(movement);
}
}