I have tried everything to remedy this. I have a script that plays animations. It plays an animation whenever there is a mouse click. This all works fine. This code works for any other animations, except for any animation where I swipe my character’s arm. I have tried other animations with this code, and it works perfectly. I have made completely new animations from scratch, but whenever it is one of the character’s attacks, it does not play the animation LOCALLY. The animation plays, it is just not played on the local client. It plays on all other clients, it plays on the server, but not on the local client in which the LocalScript is. I’m totally lost here. Animations are set to Action priority. Animations are allowed in the game - it is a group game, and the animations are made under the group. The idle animations and walking animations of the character are all lower priorities.
What really confuses me is why it doesn’t play on the local client, but it plays on all other clients. Please find the code I use below, and an attached GIF to show what is happening.
function animateChar(animationID)
local animation = Instance.new("Animation")
animation.AnimationId = animationID
local animTrack = player.Character.Humanoid:LoadAnimation(animation)
animTrack:Play()
animTrack.Stopped:Connect(function() animTrack:Destroy() end)
end
local debounce = false
function clicked()
if not debounce then
local speed = 3
debounce = true
local target = mouse.Target
local n = math.random(1,7)
local animationID = nil
if n == 1 then
animationID = "http://www.roblox.com/asset/?id=5571521261" --uppercut
elseif n == 2 or n == 3 or n == 4 then
animationID = "http://www.roblox.com/asset/?id=5571395405"--right
else
animationID = "http://www.roblox.com/asset/?id=5571465830" --left
end
animateChar(animationID)
wait(0.3)
debounce = false
end
end
Notice how I am clicking on the right window(this is the monster’s client, and it is where the LocalScipt is. The animation does not play on this side, but you can see it play on the other client’s window.