I created an animation to be played on the LocalPlayer, but when I tried it, the animation would play (TimePostion changing, markers reached) but the player doesn’t do anything, it just plays the default idle animation. I tried the animation on a rig and it worked properly first time, so is there something about the player that makes the animation not play?
Here is the animation part of my script:
local char = game:GetService("Players").LocalPlayer.Character
local hrp:BasePart = char:WaitForChild("HumanoidRootPart")
local hmnd = char:FindFirstChildWhichIsA("Humanoid")
local animator = hmnd:FindFirstChildWhichIsA("Animator")
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = cf
hmnd.AutoRotate = false
hmnd.WalkSpeed = 0
hmnd.JumpHeight = 0
hrp.CFrame = hrpcf
hrp.Anchored = true
local anim = animator:LoadAnimation(script.Animation) -- script.Animation is just the animation i want to play
anim.Priority = Enum.AnimationPriority.Action4
anim.Looped = false
anim:Play()
-- below this are the marker events which run normally, the only problem is the actual player char doesn't play the animation
No, there are no errors shown. The animation starts but nothing happens to the actual player (TimePosition changes and I can use :AdjustSpeed normally, but the player just idles).
I tried that, and it only printed when the animation was supposed to end (20 secs after start, which is the length of the anim). I’m pretty sure the issue is not the animation isn’t starting, it’s probably something with the player, considering it worked perfectly with a rig and since the markers’ function are called and the TimePosition changes. I’m not really good with animations, so it could be something else.
What I’m trying to say is that the problem is most likely due to something in the player, the animation worked fine when testing it with a rig and the exact same script.
No, as I said I’m using the player’s own character for this. This could affect the animations, but I manually load them in as my game doesn’t need a player at the start. I was just using a rig for testing, and the animation worked normally for the rig but not for the player’s own character.