Creating cancellable moves in a fighting game?

The title is pretty self-explanatory, how would I go about making a move inside a fighting game that can be canceled by getting hit/taking enough damage.

It’s been in the back of my mind for a while and I still don’t really know how to go about doing it.

Could I use coroutine.yield()?

1 Like

below code block is pretty self-explanatory

--Inside Cancel Function
animationTrack:Stop()

AnimationTrack:Stop (roblox.com)

Thanks for the reply!

How do I stop other things like hitboxes and stuff? Do I just cycle through and Destroy them?

you can simply use if, else method for prevent taking damage

--Inside Hit Function
if cancelled then
    damage = 0
end

if you using part.onTouched event for detecting hits
i suggest you to use Raycasting to detect victim is front of hitter