Delay doesn't work depending on how the button is hit

How do I…

Make the delay worked regardless of how a button is hit

What is the expected result

Player hides when ctrl is pressed, there’s a delay, then they can get out while ctrl is pressed

What is the actual result

Happens as expected if ctrl is hit by a finger and immideatly pulled away, when there’s even the tiniest of delays in pulling away your finger the character gets in and gets out almost immideatly

Related screenshots

I am not sure i understand your question correctly
I am explaining here if you press ctrl players auto hides and after ctrl is released there is delay before he get out of hiding

Make number scene variable called HideTime
Make event
Condition
Player is in collision with hiding place
If one of these conditions is true
Lctrl is pressed
Rctrl is pressed
DO NOT USE TRIGGER ONCE

Action
Change scene variable HideTime SET TO 100

And now you make another event
Condition
Scene variable HideTime is GREATER THAN 0
DO NOT USE HERE TRIGGER ONCE

Action
Change scene variable HideTime subtract 5 (THIS NUMBER you will need to adjust to your needs)
Change animation of hiding place set to hiding
Hide Player

Another event
Condition
Scene variable HideTime is less LESS OR EQUAL TO 0
Trigger Once

Action
Change animation of hiding place set to empty hiding
Show player

You should create text object place it on scene and set text of text object to Variable(HideTime)

To see what is its actual value and you can either subtract less or more from it to make delay shorter or longer

Oh no the hiding delay works, just not when you hold the button

Isn’t that what you meant?

You press ctrl player hides as soon as you release ctrl
Variable is counting down and when it counts to 0 or less player gets out of hiding place?

No it’s like they hide when i press ctrl, it doesn’t tolerate holding and releasing it

I do not get it
Tell me step by step
Like i did in in my previous message

With exactly what you expect to happen

I expect to the hiding to happen AFTER i release the button, but it happens the first time i press the button

Another question
Hiding should happen AFTER you release ctrl

But

A
I press ctrl and release it
Then after some delay player hides

B
I press ctrl and release it
But before player hides i press ctrl again
Now but that gets ignored and player hides after day from 1st ctrl press

C
I press ctrl and hold it for 2 secs or 5 or 10000
That delay starts only after i release ctrl

D
I pressed ctrl and now it does not matter do i press it again or not
Player needs to hide after delay from 1st time ctrl was pressed
Or maybe released

I don’t exactly understand, are you asking me to pick the one that’s happening?

I am asking what YOU expect to happen exactly
Cause i do not understand what you want to achieve

D, i want D to happen, but it bugs out when i hold ctrl instead of pressing it

Ok now what happens when player is hiding and press ctrl again?
Should it ignore any input?

So like
I press ctrl and release it there is half sec delay and player hides
NO MATTER did i press ctrl again or not?

when the player is hiding and ctrl is pressed, the player should pop out of the hiding spot

Now i understand even less
So you want it to work as toggle state?

You really need to explain exactly what you want to achieve
Its in your best interest to provide as much info as you can

So basically, when a player presses CTRL, the player hides, when they press CTRL again they unhide. But i want a delay long enough that if you press CTRL again it doesn’t just IMMIDEATLY pop out

Press Q

Thank you a lot, it works as expected now!

1 Like

Let that be a lesson for you
Better you explain what you expect easier it will be to get help here
Sadly i learned it the same way as you did
Have fun

1 Like