GetMarkerReachedSignal() changed variable too early

Hey guy,i was mess this thing up for 3 day but i cant find how to resolve. So whats my problem here? Well, its not a problem that cause a error to script but its a problem that cause me a fustruated because i have no idea how to resolve it

So i made my own attack animation with animation events on animate editor (roblox default animatior). When it reached to trigger my function.
I made a images for explain how all my things work!

(Action : In) When detected will trigger function that make player cant move around
(Debounce == true) When detected will trigger function to change boolean in scriot to true to make player cant click to trigger function repeatly again
(HitBox = 0.75) When detected will trigger function that create hitbox
(Debounce == false) When detected will trigger function to change debounce to false allowed player to click in this moment
(Action : Out) When detect will trigger funcrion that allowed player to move again


GetMarkerReachedSignal of “Action” and “HitBox” is work perfectly fine they work sync to animation BUT that’s not the problem. A problem is GetMarkerReachedSignal of “Debounce”. As i said its not a problem that cause a error, it problem is animation playing now didnt get reached to “Debounce = false” because it should print(Debounce) on output detected “Debounce” which was supposed not triggered attack function repeatly when debounce was be true

Local function AnimationEventDebounce(Parameter)
   Print(Parameter)
   Debounce = false
End 

but however function was changed boolean to false before it detect “debounce = false” which is not what i wanted

“Reminder that boolean i talk about is variable in script”

local debounce = false -- variable/scope/boolean, or whatever you call it

So this is my script


Can anyone resolve my problem? Thanks!

2 Likes