Hey! im following a tutorial on 3d movement based on Unity's more recent input system.
The error that I'm getting is:
'PlayerControls' does not contain a definition for 'PlayerMovement' and no accessible extension method 'PlayerMovement' accepting a first argument of type 'PlayerControls' could be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]csharp(CS1061)
My code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InputManager : MonoBehaviour
{
PlayerControls playerControls;
public Vector2 movementInput;
private void OnEnable()
{
if (playerControls == null)
{
playerControls = new PlayerControls();
playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue();
}
playerControls.Enable();
}
private void OnDisable()
{
playerControls.Disable();
}
}
↧