Hi All,
I’ve been stumped by the input system. I followed a YouTube tutorial (i think) to the letter, but when I playtest my game no input is detected from either my keyboard or my controller. However, I assigned the right stick to the Cinemachine input provider, and this works fine so it can’t be the input devices themselves.
Also, while trying to troubleshoot the issue suddenly the listen function of the input system stopped working.
I have set up my inputs like this:
and i’m using the following basic player movement script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovementScript : MonoBehaviour
{
sysPlayerControls _controls;
Vector2 move;
public Rigidbody _player_rb;
void Awake(){
_controls = new sysPlayerControls();
_controls.Player.Movement.performed += ctx => move = ctx.ReadValue<Vector2>();
_controls.Player.Jump.performed += ctx => Jump();
_controls.Player.Movement.canceled += ctx => move = Vector2.zero;
}
void Update(){
Vector2 m = new Vector2(move.x,move.y) * Time.deltaTime;
transform.Translate(m);
}
void Jump(){
Debug.Log("Attempt to Jump");
_player_rb.AddForce(0,20,0);
}
void onEnable(){
_controls.Enable();
}
void onDisable(){
_controls.Disable();
}
}
Thanks in advance for any help
