u/Artistic-While-5094

Input System doesn't work.

I have started a new project and began implementing the basics. And for some reason, after setting up an Input-Actions-Editor, adding a simple Action and the bindings and dragging the Input-Action-Reference into the Inspector, the Code simply won't work, despite me pressing the key. I've checked an old project of mine and it seems like I've done nothing different.

using System;

using UnityEngine;

using UnityEngine.InputSystem;

public class PlayerController : MonoBehaviour

{

Rigidbody2D pRb;

Collider2D playerCollider;

private float speed = 10;

private float jumpHeight = 2;

private float gravity = -9.8f;

public Vector2 walkDirection;

public bool isOnGround;

public Collider2D groundcheck;

public LayerMask groundmask;

public InputActionReference Move;

public InputActionReference jump;

...

void Update()

{

if (jump.action.IsPressed())

{

Debug.Log("uzvflf");

}

}

Maybe I'm just not understanding the Input System but afaik, all you have to do, is creating an Action and then reference it like this.

reddit.com
u/Artistic-While-5094 — 7 days ago