I am working on a project and I am trying insert a script into the “player” panel. But when I try it says to fix an error in a script first. Can anyone help me?
here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
private playerInput playerInput;
private playerInput.OnFootActions onfoot;
private PlayerMotor motor;
// Start is called before the first frame update
void Awake()
{
playerInput = new PlayerInput();
onfoot = PlayerInput.onfoot;
motor = GetComponent<PlayerMotor>();
}
// Update is called once per frame
void FixedUpdate()
{
motor.ProcessMove(onFoot.Movement.ReadValue<Vector2>());
}
{
private void OnEnable()
}
{
onfoot.Enable();
}
private void OnDisable()
{
onFoot.Disable();
}
}