Hi!
I’ve been trying to get PlayerActionSets working and can’t get it working and I’m out of ideas - I changed my code to be as good as 100% identical to the Example. But I seem to be missing something.
This is my PlayerActionsSet:
using UnityEngine;
using System.Collections;
using InControl;
public class PlatformerPlayerActions : PlayerActionSet {
public PlayerAction Left;
public PlayerAction Right;
public PlayerAction Jump;
public PlayerOneAxisAction Move;
public PlatformerPlayerActions() {
Left = CreatePlayerAction("Move Left");
Right = CreatePlayerAction("Move Right");
Jump = CreatePlayerAction("Jump");
Move = CreateOneAxisPlayerAction(Left, Right);
}
public static PlatformerPlayerActions CreateWithDefaultBindings() {
PlatformerPlayerActions playerActions = new PlatformerPlayerActions();
Debug.Log("asd");
// Keyboard
playerActions.Left.AddDefaultBinding(Key.LeftArrow);
playerActions.Right.AddDefaultBinding(Key.RightArrow);
playerActions.Jump.AddDefaultBinding(Key.Space);
return playerActions;
}
}
In my Start() I call:
characterActions = PlatformerPlayerActions.CreateWithDefaultBindings();
And then in FixedUpdate/Update:
if(characterActions.Jump.WasPressed) {
Debug.Log("jump!!jkA");
}
But whenever I press space, nothing happens.