FullMe7alJacke7
New member
I'm having trouble figuring out how to hook into the new unity input system.
I tried using the conditional IsMouseDown which is not getting triggered, I would imagine due to the changes they made in how the unity input events are handled.
I am attempting to hook into these via script and just send a message to the BT's Has Received Event instead but I can't seem to figure out how I would go about that.
I was thinking something along the lines of
My question is how would I hook it up to register to the event, if that line will indeed work.
I would imagine to register to the event it is simply
The idea was that this will be a behavior tree for how to handle input depending on game state as I handle multiple buttons that have multiple functionality depending on whats going on in the game.
EDIT: After more fiddling around this is what I currently have but I am getting StackOverflowExceptions.
I tried using the conditional IsMouseDown which is not getting triggered, I would imagine due to the changes they made in how the unity input events are handled.
I am attempting to hook into these via script and just send a message to the BT's Has Received Event instead but I can't seem to figure out how I would go about that.
I was thinking something along the lines of
Code:
controls.Default_ActionMap.LeftClick.performed += context => behavior.SendEvent(controls.Default_ActionMap.LeftClick.name);
My question is how would I hook it up to register to the event, if that line will indeed work.
I would imagine to register to the event it is simply
Code:
behavior.RegisterEvent<object>("LeftClick", myActionHere );
The idea was that this will be a behavior tree for how to handle input depending on game state as I handle multiple buttons that have multiple functionality depending on whats going on in the game.
EDIT: After more fiddling around this is what I currently have but I am getting StackOverflowExceptions.
Code:
Action action = () => behavior.SendEvent(controls.Default_ActionMap.LeftClick.name);
behavior.RegisterEvent("LeftClick", action);
controls.Default_ActionMap.LeftClick.performed += context => action();
Last edited: