Hey, I am working on a Kame Hame ha move but I want to make it holdable.
It consists of 3 Animations. 1, Startup. 2, hold. 3. Do move. I want it to play the Startup before it can do the Do move animation the script uses 2 parts Hold move and Release
Local script
UIS.InputBegan:Connect(function(Input,isTyping)
if isTyping then return
elseif Input.KeyCode == Enum.KeyCode.G then
if Debounce.Kame == false and Move == false then
Move = true
Debounce.KameAct = true
Moves.KameRP:FireServer(true)
end
end
end)
UIS.InputEnded:Connect(function(Input,isTyping)
if isTyping then return
elseif Input.KeyCode == Enum.KeyCode.G and Debounce.Kame == false then
Debounce.Kame = true
Moves.KameRP:FireServer(false)
wait(Coldounces.Kame)
Debounce.Kame = false
Move = false
end
end)
Server Script
--I don't actually wanna leak my code so
Moves.KameRP.OnServerEvent:Connect(function(Player,Active)
if Active == true then
--Plays KameStart anim
else
--does the actual move
end
end)
You can either play the animations in order after the button is pressed or if you want to maintain the hold mechanism you could check with InputEnded if the first animation is still playing it will ignore the next animation else it will play it
Just use debouncing as you have done to prevent animations from playing on top of eachother.
You can always consult the “IsPlaying” property of the AnimationTrack instance which stores/holds a Boolean variable which describes if the AnimationTrack is actively playing or not, with this information you can allow the animation to finish playing before starting the playing of another or start playing an animation immediately if one currently isn’t being played.