Exactly what the title says
I have a taunt animation, it freezes player’s movement when played
When a player on PC presses G, it plays perfectly
But a player on mobile needs to press a button in order to play this taunt
First, it plays, but when i reset and click the button again my movement is freezed, but the animation doesnt play
I tried searching forum for the answers, but they dont seem to help me
local humanoid = game.Players.LocalPlayer.Character:WaitForChild('Humanoid'):WaitForChild('Animator')
local playing = false
local anim = script:WaitForChild('Taunt')
local playAnim = humanoid:LoadAnimation(anim)
local sound = humanoid.Parent.Parent:WaitForChild('Sound')
local UIS = game:GetService("UserInputService")
script.Parent.MouseButton1Click:Connect(function()
if playing == false then do
playing = true
print('playing')
UIS.ModalEnabled = true --freeze player
sound:Play() --music n stuff
playAnim:Play()
end
else -- but if playing == true
UIS.ModalEnabled = false --unfreeze
playing = false
playAnim:Stop()
sound:Stop()
end
end)
game.Players.LocalPlayer.CharacterAdded:Connect(function() --if player respawned variables reset
local humanoid = game.Players.LocalPlayer.Character:WaitForChild('Humanoid'):WaitForChild('Animator')
local playing = false
local anim = script:WaitForChild('Taunt')
local playAnim = humanoid:LoadAnimation(anim)
local sound = humanoid.Parent.Parent:WaitForChild('Sound')
end)
if you need PC/Console script i can send it
Thanks