I decided to convert my game to use the new Input Manager, however, even after following multiple tutorials, nothing works. I even created a test function using the buttonSouth
, but that didn’t work.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMove : MonoBehaviour
{
PlayerController controls;
public float speed = 7;
public float lerpSpeed = 5;
Vector2 move;
private void Awake()
{
controls = new PlayerController();
controls.Gameplay.Test.performed += ctv => Test();
controls.Gameplay.Move.performed += ctx => move = ctx.ReadValue<Vector2>();
controls.Gameplay.Move.canceled += ctc => move = Vector2.zero;
}
void Update()
{
Vector2 m = new Vector2(-move.x,move.y) * Time.deltaTime;
transform.Translate(m, Space.World);
}
void Test()
{
print("Hi");
}
}