How do i force a release upon not following a condition?

I want to be able to force a release on the key when the condition of points >= 10 is false

However, when held down; I am forever allowed to follow what the condition acceptance once was, which was true so boosting is forever true until i release spacebar, of course.

Ive heard theres ways to go around this simple logic but I cannot find a solution to this.
OBS! I do NOT have a widget interaction for the “release key” node unless there arent any default placed ones on character bp class

I can still just hold down spacebar and reach 9 but still have the boosting speed

you can move the logic to a custom event that the Released exec pin fires.

Gate off the ability to fire the event with the condition as shown, then also poll for the condition and call the event when the condition becomes true.

Poll can mean watch the condition on tick, or on a timer, or if you know when the condition changes you can fire event from there.

Basically it’s like separating this little nugget of logic to be it’s own thing, then you can call it from multiple places using multiple conditions.

How, it won’t go down the true branch if points > 10 ?..

Hence, points must be > 10.

Does “pressed” only occur once or loop when held down?

If its once then the condition will always be true since thats what it started with,
If its looped then this would go through but it doesnt, same would any print text

Once, I think.

Do you know any way for this to be a loop instead? When people are talking about charged attacks in rpg games, dont they need to know when theyre holding the mousebutton down or casually pressing mouse button?

Or overall if theres any other than “Spacebar” function

Then you need to use a axis input node, like inside the player character.

using enhanced input will give you much easier time for stuff like you’ve mentioned. you can use binary inputs but also detect when they are held, and also add special triggers (like hold for X amount of time fires a trigger).

you can wrangle an input axis to act like a binary input (on / off) but it’s a ton more code that you have to write, compared to letting the epic team handle all that for you

I have no idea what an axis input node is, Do you mean analog keys?
like this one?
image

I searched for “Binary inputs” in unreal engine documentary and as I was looking for the “input action” but I have no idea how to find this since it doesnt exist for me


, any idea why or am I even doing it correctly?

If you’re on 5.x, you can just look inside the first for third person character. It’s the new enhanced inputs :slight_smile:

sorry, that is my own terminology because i couldnt think what else to call it.

Basically there are two types of input. Action and axis.

An action turns on and off. That’s what I am calling binary. Binary means value can only be 0 or 1, aka true / false, aka on and off.

Axis is reading a value constantly to detect values between 0 - 1. Like if joystick is pressed halfway, it would be 0.5.

You are asking so many fundamental questions though, you really ought to go through a handful of epics beginner tutorials you can find in the learning area. There’s just tons of stuff that if you don’t have somebody just show you right off the bat, you’ll spend ages doing things in suboptimal way simply because you don’t know what exist in the engine.

An intro to enhanced input tutorial might be a great place to start.

Im using topdown and im not really finding the input category on “create advanced asset”

So theres currently no easy and simple way to make this “hold down space to boost” possible?

When you right click and the menu appears, just start typing ‘input’. This

image

is what you want. But I would recommend watching a vid first

1 Like

well the easiest method to do input in unreal right now is the enhanced input.

yes, it has some weird terminology and you have to have some fundamental understanding of some programming concepts for it to make sense, and that can take some hours to get a handle on… but, there is tons of video tutorials explaining it all. you can take your pick like a buffet - if one author has a voice that annoys you, find another, lol.

that is easiest because epic has made a lot of things like what you want to do just a few parameters you can turn on or off. So just a ton less code you’ll have to write.

In general, game programming is always a much bigger PITA than you’d expect it to be, so just get used to that.

1 Like