My animation does not seem to want to play. I believe I have the correct ID and I know that the animation priority is set to Action. No errors. The animation is being played, but there is no visual animation happening. (When I go to test it, it shows it as running, but does not provide any visual change to my character) Below is my code.
local player = game.Players.LocalPlayer
local char = player.Character
local UIS = game:GetService("UserInputService")
wait()
local function createNewAnimation(animationID)
local newAnimation = Instance.new("Animation")
newAnimation.AnimationId = animationID
newAnimation.Parent = script
return newAnimation
end
local SToS = createNewAnimation("rbxassetid://6002096252")
local Animator = char.Humanoid.Animator
UIS.InputBegan:Connect(function(key)
if key.UserInputType == Enum.UserInputType.Keyboard then
local keyPressed = key.KeyCode
if keyPressed == Enum.KeyCode.N then
local SToSAnimTrack = Animator:LoadAnimation(SToS)
SToSAnimTrack.Looped = false
SToSAnimTrack.Priority = Enum.AnimationPriority.Action
SToSAnimTrack:Play()
SToSAnimTrack.Stopped:wait()
end
end
end)

5 comments
Is this a local script?
Local script, correct
in my opinion it would be better to instead of creating a new animation that you clone one from ReplicatedStorage or ServerStorage
Maybe so, but I do not believe this would fix my issue. I am not available at my PC to test it though.
No, this did not end up fixing my issue, but I understand the practicality of doing this. Thanks for your advice Pitched.