Download

Is there a way to make an input key act like it is held down yet it was only momentarily pressed?

What I’m trying to do is implement an 8 way dodge roll like when pressing left alt while holding a movement direction. What I’m doing is just using an increased walk speed for .45 seconds to simulate a dash and with the animation is looks fine IMO.

The problem is, even though setting a delay on the left alt input allows the animation to play out as long as I wanted, I can’t get the roll right or simply D to basically “hold” or sustain itself even if it is just a momentary button press. If I hold D while tapping left-alt it looks fine. But I do not want that. I want a momentary press of D+left alt to set the character walking right at the increased speed for .45 seconds while disregarding all other directional movements.

Any and all help is greatly appreciated, I do not know what I’m doing wrong.

the word you are looking for is “toggle”, my friend.

Please describe what each button is supposed to do?
Does lAlt make them “roll”?
If I understand right, you want the character to move quickly in 1 direction if you hit lAlt and a direction, but then move at normal speed after .45 seconds even if lAlt is still pressed?
If so, Take the delay off of the lAlt release, Put delay AFTER set max walk speed to 1200, then make the max speed normal

That already works, however just pressing left-alt the character rolls in place. But, if I hold to the right and hit left alt the character does a roll w/ animation and the walk speed is quickly boosted to 1200 (which is faster than 1000 sprint and 250 walk), and once the roll is over goes back to how it should be.

What I’m getting at is there a way to have that sustained momentum (but not launch character or LERP) of walking right like I was holding the D key .45 seconds but to just do it itself? Surely there is some way to simulate a phantom input key “button press” for .45 seconds then stop. But its not a phantom press. It would be me pressing right (D key) one time momentarily (not .45 seconds) while simultaneously hitting left alt and the character would immediately walk @ 1200 speed for approximately .45 seconds then return to whatever state is was in before. I have an idle_walk_run blend space, and also a crouch blend space.

I also think ultimately in this chain I will need to implement disable input and enable input once I can get the walk motion locked in and while the animation is playing.

In electronics, there is what is known as a momentary switch. This button when pressed completes the circuit, think an old school doorbell, however, a toggle switch would be like a typical wall light switch. I see there are set toggles for a physics thruster, I tried hooking the pressed and released from a button to it but it did not achieve the momentary switch effect, but instead acted in ways like a flip flop node.