I’m currently creating a tutorial, the idea i have is to have an actor “BP_Guide” that will contain a transparent box, and when the player overlap that box, slow down the time and show a Text-Renderer indicating which key he have to press, for example Jump.
Upon pressing that key, the text will blink in green shortly, then the actor will be destroyed and the time dilation will revert to normal.
What i have done is i created a Variable of type : “Input Action” that i called “Target Action” in this actor, it is instance editable, so i can easily create multiple of theses boxes in a stage and have them require different inputs, Jump, Crouch, Attack and so on…
Now i need to somehow find if that input is “Active” or “pressed” but i dont know how i could do that…
the idea i had was to check on Tick all the inputs that are active, and add them inside an Array of active inputs, and if the key is not active, remove it’s action from the same array, then try to find if the “Target Action” exists inside this Array, but that dosent work for some reason.
I tried multiple variants but i cant figure it out.
Im sure there must be a simpler way to figure if an Input is active or not…
Instead of caching all the inputs inside an array, why not cache the specific input into a boolean check? Then you can call a branch node to check whether the boolean value is true or not. I hope I didn’t misunderstand the question here.
So you would suggest the same principle, but if “is input key down” is true, store a boolean in an array, then use the key index to find that specific boolean ?
im not sure how you want to do it, could you elaborate ?
The problem is that i dont want do store individual booleans for each inputs, that would be cumbersome and annoying for modularity.
Same, i cant store a single variable “Input Action” and replace it everytime a new key is pressed, because in that case, only the last key pressed would be recognized inside the trigger box.
I effectively need a reliable method to know every active input from my IMC…
If it bothers you to use a Boolean check, then you can use a Gameplay tag. For me, I would personally go for the event dispatcher method or the interface call method, with an enumeration/key input as the parameter. You can also add flow control to ensure only 2 inputs are accepted at a time through a localised function.