I wanted to make my game playable with controller, and the best option seemed to be the new input system, so I tried it with Brackey’s tutorial but half of the stuff just doesn’t work. I have here a screenshot of the input mapping I used.
Instead of following the rules I set, for some reason it only jumps with space and Lshift (which isn’t mapped there) and dives with Lctrl, nothing else. No movement, no throwing, nothing. This is the relevant code I used.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovement : MonoBehaviour
{
bool GetJump = false;
bool GetThrow = false;
bool GetDash = false;
private void Awake()
{
controls = new PlayerInput();
controls.PlayerControls.Movement.performed += ctx => movement = new Vector2(Mathf.Sign(ctx.ReadValue<Vector2>().x), Mathf.Sign(ctx.ReadValue<Vector2>().y));
controls.PlayerControls.Movement.performed += ctx => movement = Vector2.zero;
controls.PlayerControls.Jump.performed += ctx => GetJump = true;
controls.PlayerControls.Jump.canceled += ctx => GetJump = false;
controls.PlayerControls.Throw.performed += ctx => GetJump = true;
controls.PlayerControls.Throw.canceled += ctx => GetJump = false;
controls.PlayerControls.Dive.performed += ctx => GetDash = true;
controls.PlayerControls.Dive.canceled += ctx => GetDash = false;
}
}
Mostly made it this way to not have to alter 70% of the already made code. With this I just used the bools I made to check for input and do the actions. Any idea of what might be happening? I’ve been trying to fight with the input system all day and I just can’t figure it out.