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;
The code you posted won’t even compile on its own, I don’t think. PlayerController is not one of Unity’s classes. If it’s your own, then we have no idea what it does. Also, we don’t know if you’re using the Player Input Manager component in the scene and wiring up to your methods, if you’re using Unity Events, etc…
Can you elaborate on this? I have been working on a game and just got some UI built and it seems the event system isn’t even picking up any UI elements.
That doesn’t seem related to my post/the original post. Mine was about, if you’re using a generated C# Input Actions object, you need to call .Enable() on it after creating it.
The issue is that “performed” will NOT trigger on key down, nor on key up but only if you HOLD the key pressed for a while due to the “hold” configuration. This can be suprising as the name “performed” would make you think (if used from code) it executes on key up, which it does not necessarily do. If you press the button only shortly (as most people do by default) it will never trigger the performed callback at all. Of course this is due to the “hold” configuration and thus correct.
Solution: Use “started” for this or remove the “hold” type interaction.
It all makes sense but I think the suprise is Unity setting the default of “Interact” to a hold of 0.5 Sec.