i have problem with my code with command “using UnityEngineUI;” in my code i have error after using this… this is the code and ERROR
CODE
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngineUI;
public class PlayerMovement : MonoBehaviour{}
public class PlayerActions : MonoBehaviour
{
[Header("Config")]
[SerializeField] private float speed;
private readonly int moveX = Animator.StringToHash("moveX");
private readonly int moveY = Animator.StringToHash("moveY");
private PlayerActions actions;
private Rigidbody2D rb2D;
private Animator animator;
private Vector2 moveDirection;
private void Awake()
{
actions = new PlayerActions();
animator = GetComponent<Animator>();
rb2D = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
ReadMovement();
}
private void FixedUpdate()
{
Move();
}
private void Move()
{
rb2D.MovePosition(rb2D.position + moveDirection * (speed * Time.fixedDeltaTime));
}
private void ReadMovement()
{
moveDirection = actions.Movement.Move.ReadValue<Vector2>().normalized;
if (moveDirection == Vector2.zero)
{
return;
}
animator.SetFloat(MoveX, moveDirection.x);
animator.SetFloat(MoveY, moveDirection.y);
}
private void OnEnable()
{
actions.Enable();
}
private void OnDisable()
{
actions.Disable();
}
}
ERROR: " error CS0246: The type or namespace name ‘UnityEngineUI’ could not be found (are you missing a using directive or an assembly reference?)"