#coroutine issues
1 messages · Page 1 of 1 (latest)
actually it's called in a different function that's called in process but it just uses the returned bool to check if it should emit a signal or not.
is this function being called every frame a key is held? if so the timer will keep restarting since youre calling start() so it will never time out.
No it's being called the first frame the key is held
Can you show where its being called.
it's being called in here
and that is being called in here
Still not surefooted on a lot of this stuff so there's a large chance I did a big no-no here
I recreated what you have and this "Works" Though probably doesnt work the way youre expecting.
If i hold the key sure that will print my statement after 2 seconds. but even doing the just_released bit even with a click it will still print
Because when it runs through this check function it just runs through for when I click the button and in that frame just_released is false so it still prints
I would try to create a system using signals instead of waiting on timer timeouts and start/restarting the timer when the input is held or released and do the action on the timers timeout with a signal.
ignore the state_machine stuff i just opened an old project to recreate it
Ah ok