How do I make an ability with an animation that requires someone to touch the player

How do I make an ability with an animation that requires someone to touch the player and only then continue the ability script, or activate the cooldown if the player didnt touch someone in 3 seconds?

An example is a dropkick from KJ Dropkick test: if you touched someone while you are running, the dropkick animation will play, but if you fail to do so in time - the animation stops and cooldown is activated.

A full script is not required, i just want a part of it, like

runAnimation:Play()
repeat wait() until bla bla bla or your solution
--do something 

they probably just use spatial queries or just weld an invisible cancollide false hitbox part to the character and have a touched event that they disconnect once it hits something its probably the second option tbh since all those KJ games are very low quality :skull:

1 Like

As for my solution i dont think this gonna be a good one

Add a value in the character of the running man once he started running when he stops for 3 seconds remove that value

When he touchs someone check if that value still inside him if yes that means he is still under effect if not do nothing and activate cooldown

Sorry if there is anything wrong

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.