Hi, I am trying to integrate the generated class from my input resource into Bolt adding the generated types into Bolt units but it didn’t work all the way through…
Anyone have had done this or had an idead on how to do it?
Hi, I am trying to integrate the generated class from my input resource into Bolt adding the generated types into Bolt units but it didn’t work all the way through…
Anyone have had done this or had an idead on how to do it?
Jason’s extension pack also includes an integration for the new input system:
In his last two updates before quitting open source, he removed input system types and units https://github.com/LifeandStyleMedia/BoltExtensions/releases/tag/1_3_1 and the previous one he warned to not use it due to being unstable and buggy https://github.com/LifeandStyleMedia/BoltExtensions/releases/tag/1_3_0.
Well the way that I found to use it, it to have a script that will write the values to a scriptable object and then Bolt consumes from that scriptable object…
A bit confused about this. Is it now not possible to use new input system with Bolt, or you can use the return event nodes?
Is it possible to provide a sample, please?
edit: never mind i found out that you can use custom event nodes and CustomEvent.trigger() in code to link the unity input events and bolt
@gvidov do you have any reference/tutorial for that?
What about Bolt 2? Will the new Input System be fully supported?
I haven’t yet gotten the chance to try Bolt 2, but from what i read at the time, they plan to implement the input system.
Here’s how i did it.
using UnityEngine;
using UnityEngine.InputSystem;
using Bolt;
public class InputEvents : MonoBehaviour
{
private Controls controls;
private InputAction moveAction;
void Awake()
{
if (controls == null)
{
controls = new Controls();
}
controls.Enable();
moveAction = controls.PlayerActions.Move;
controls.PlayerActions.Jump.performed += Jump_performed;
controls.PlayerActions.Jump.canceled += Jump_canceled;
moveAction.performed += ctx => Move_performed(ctx.ReadValue<Vector2>());
moveAction.canceled += ctx => Move_canceled(ctx.ReadValue<Vector2>());
}
private void Jump_performed(InputAction.CallbackContext obj)
{
CustomEvent.Trigger(this.gameObject, "onJump");
}
private void Jump_canceled(InputAction.CallbackContext obj)
{
CustomEvent.Trigger(this.gameObject, "onJumpCancel");
}
private void Move_performed(Vector2 direction)
{
CustomEvent.Trigger(this.gameObject, "onDirInput", direction);
}
private void Move_canceled(Vector2 direction)
{
CustomEvent.Trigger(this.gameObject, "onDirInputCancel", direction);
}
You can pass arguments like for directional input
Transition in State Graph
Here’s the State Graph Tree
Hello. I’m a C# newcomer and I’ve been trying to do what you did to link the new input feature to Bolt for a while. My script is not compiling correctly, and I believe it is because of the names of my files. Can you clarify what files are you calling in this script and which ones I should change ?
here are my errors. Maybe it’s something else.
Sorry for the late reply and i hope this is still relevant. I think in your case the problem is the reference to Controls script. for me the Controls script is the Unity input systems generated c# class name for the Input Action Asset