How to make new enhanced inputs keep firing?

So with old mappings, axis like gamepad trigger would keep firing like a tick even when you weren’t even touching them. in result, when you released them, they kept firing a value of zero.

I’m trying to update a code for the new input actions, but they stop firing when you release, so it doesn’t ever zeroes out, the last value is like 0.002 or something, which changes the behaviour of my camera zoom code.

Even if I use a tick and only get the action value from the IA, it stops sending values when I release the trigger. Is there a way to make it keep firing?

And while at it, mouse wheel button is working weirdly as well. with the old system, axis value would be 1 or -1 for a tick, and then back to 0. now action value stays at 1 or -1. is there a way to make it work like before as well?

Hey @fael097!

Can you show us the code?

You might want to try maybe using “Triggered” instead of “Started?”

1 Like

Sure, here it is:

Both sets of inputs are mapped the same, picked up raw.

Captura de tela 2023-10-27 161616
Captura de tela 2023-10-27 161742

I am using “Triggered” in fact, but it doesn’t work the same. I even added a tick for it to keep triggering, but as I mentioned, the action value I get stops sending any data as soon as I let go of the trigger, before being allowed to zero out.

You can see the print string results here:

Blue is the old input, red is the new.

When red turns to 1 or -1 it’s the mouse wheel. you can’t even see it becoming 1 or -2 in blue since it only happens for a tick, while red stays at that value until you change it, so it never zeroes out.

then when it shows many decimals, it’s the trigger axis values. you can notice they stay the same in both blue and red when I’m pressing them, but as soon as i let go, blue zeroes out, and red stays just short of 0. this without deadzones. i tried adding some but it doesn’t change this behaviour.

What is it you’re looking for? Are you needing it to hit 0 for your camera code to work? Because if so, I’d suggest using an “Almost.” Use a “<” node with say, 0.2. Because Axes are a little wonkier than one might think- getting them to go back to zero is very difficult unless the physical controller is brand spanking new, and usually not even then.

If you are looking for a “non-input” value, do an “IsValid” Check on the value. If it is “NOTValid” that means it’s null, try using that! I’m not sure that will work but that’s what my brain says to try based on experience.

My controller is dead atm but I think you just need to use the “completed” trigger as well as the “triggered” trigger. The “completed” trigger fires the frame after the mouse wheel was triggered, the “triggered” trigger fires only on the frame when the value of the mouse wheel is -1 or 1. The analogue sticks behave the same way and are only reporting the value of the last frame they were triggered on, which is never going to be zero because if it was the “triggered” trigger would not fire. If you expand the EnhancedInputAction IA_WheelAndTriggers the completed trigger is right above the action value. Sorry for using the word trigger so many times… I could not think of a better word for it.

I just use the IA to set a variable and then on event tick check the variable for my ship pitching function

1 Like

This is a function to smoothly zoom in or out the camera using the mouse wheel.

it uses a Gate, a Retriggerable Delay, and a Finterp To nodes for it to work with the old input system.

This doesn’t really work with the Enhanced Input Actions, and if you want to know why, I tried describing it in detail below, and you can also try it yourself, but TL;DR how could I make another smooth zoom in and out system using the new input system?
.
.
.
.
.
.
.
.
Why it doesn’t work:

( can I collapse this whole text somehow, like a spoiler tag in other forums, so most people won’t be scared looking at this enormous wall of text?)

Since the old axis input actions kept firing constantly even when no input was being given, it allowed this function to use the gate node. with a branch checking if the axis value was > 0, it would trigger the open the gate once (since scrolling the mouse wheel would only out an axis value of 1.0 for a tick), and then with a retriggerable delay, keep it opened for one second (enough time to zoom in/out the camera smoothly).

Then with an finterp to, the Arm Length of my character camera spring arm would smoothly increase or decrease for one second, executing the smooth zoom in or out action.

Now, with the enhanced input actions, axis inputs don’t trigger constantly (which is probably better, but i digress), so it won’t keep firing for the finterp to node to smoothly icnrease the spring arm length.

Of course I could do a workaround and use a tick event for it to keep firing, but the problem is that before, the axis value for the mouse wheel would only be 1 (or -1, if you scrolled down) for a tick. so the value for the Finterp to node to work with would only be calculated once, zooming in only a certain distance.

Now, the Action Value for the enhanced input action (which replaces the old Axis Value), keeps sending a value of 1 (or -1) constantly, even though you only scroll up or down with the mouse wheel once, so the Finterp To will keep calculating a value over the 1 / -1 and will always zoom in or out to the maximum range every time, and not to an interval.

I could use the start and completed exec nodes from the enhanced input evet, mixed with a “greater than 0” branch connected to the action value pin to set a float variable to either 1.0 or -1.0 on started, and back to 0 on completed, but not all mouses have the same wheel system, with a well defined step. some of them keep scrolling, some of them stay “clicked” for a bit long, so this wouldn’t work all across.

I could use the mouse wheel as a bool action instead of axis since it doesn’t really gives me any value between 0 and 1 so it could probably work better across all mouses, but this same Input Action event that I’m using for this camera zoom function isn’t only getting data from the mouse wheel, it’s also triggered and receives values from gamepad triggers. Left trigger ranges from 0 to -1 and Right trigger from 0 to 1.

If that was perfectly true, even thought the mouse wheel wouldn’t work perfectly, I could still use the afore mentioned tick event along with the gamepad trigger values to have it working like before. but it also doesn’t work like that.

Gamepad triggers used to work perfectly, returning an axis value of exactly 1 when fully pressed, and exactly 0 when not pressed, and any float in between while pressing through the entire range of the triggers.

But now, they don’t. Based on everything described, this is probably because the axis input events stop firing now when you let them go, so if you just release the trigger, it will -always- stop firing before the axis value hits 0.

So, resulting in a problem similar to the mouse wheel issue, the axis value for the triggers won’t stay at 0, and the Finterp To node will keep adding values to the spring arm length after you let go of the trigger. slow values and only for one second until the retriggerable delay ends, but enough for this function to respond poorly, and not intuitively like a simple trigger press.

needless to say, this new input system isn’t proper for replacing the old one in this function. I tried finding workarounds or even rewriting the code for the new input, but couldn’t come up with anything that would work.

I mean the fix would be to check a variable set by the IA I use it that way for pitch, yaw, roll controls so that I can fire reverse thrusters when the player stops pitching

Essentially the IA sets the value of the variable pitch rate

That variable is read in a function on event tick if 0 do nothing if > or less than 0 do thing and it works great for me


1 Like

maybe I’m missing something I put your code in my game exactly as it is and it works fine? I had to tweak the min and max so i could zoom out enough but otherwise it seemed to be working as intended

1 Like

with the old inputs it works fine, problem is when trying to adapt to the new enhanced inputs

It will hit 0 if you use my example above with the new inputs as I have done this works for me I use it to smooth out my players ship movement (the pitch up and after coming to 0 the ship fires reverse thrusters to slow the ships pitch)

1 Like

To be more clear as to why mine goes to 0 when you fully let go the Input Action calls completed this didn’t happen in the old system it just kept ticking at 0 in the new system if you set the variable to 0 and use the variable as your value it will go to 0 when the Input action goes to completed

1 Like

You’re absolutely right. Using this method, both inputs result the exact same value:

Now, is there a way to make the enhanced input keep firing permanently, or at least for like 5 seconds after triggered, so I don’t have to use a separate tick event?

as far as I am aware tick will be required.

yeah, not for this simple example, but for the camera zoom which uses an Finterp To node, you need a tick firing for the whole duration of the interp speed, like this:

I’m trying to get rid of the tick event

Sorry :sweat_smile: I was agreeing I just worded it weirdly

Yes tick is required in the example above, tick or a really low value timer but tick is probably better in this case

1 Like

Right, yeah

But my question remains, can I somehow set the input action to keep firing when triggered for X seconds?

you could have the proceeding code keep running but not the input action its self

for example an auto run system

player presses W the character moves forward then stops

player holds W long enough to trigger the auto run

player lets go of W and the function (on a timer or something) keeps calling over and over making the player run

This is an interesting idea, but it doesn’t really work.

You can’t set the timer to 0.0 (like you can set a print string node so it keeps printing consistently on every tick), or it’ll clear itself and execute nothing.

You can set the timer to a time lower than a tick, but it still doesn’t work. I suppose firing a function multiple times in a very short period still isn’t the same as a tick. it’s not continuous so the Finterp to node doesn’t do anything as it’s probably triggered for only a tick when the function fires and then reset instantly.

But I mean… It has to be a way to set up the input action to stay triggered for a few seconds after you let go of the input, right? maybe set it to think the input is still being pressed for a while after you let it go?

It sounds so simple, so obvious, and I can think of a million uses for this

I ended up using a tick event to keep firing. But returning to the original question, there’s no way to make an enhanced input to keep firing, be it for a specific amount of time, or forever? can anyone affirm this?

1 Like