Hello. I made a script for an attack but for some reason, the animation called “loadedcutp2” doesn’t play whatsoever. It is currently set to Action priority, but I tried previously to set it to action 4 but it still did not work. Help is appreciated, thank you.
if input.KeyCode == Enum.KeyCode.E then
local stunned = player.Character:GetAttribute("Stunned")
local debouncewait = false
local debounce = 0
if not debouncewait and (stunned == false or stunned == nil) then
debouncewait = true
player.Character.Humanoid.WalkSpeed = 0
local loadedCutp1 = player.Character.Humanoid:LoadAnimation(cutp1)
loadedCutp1:Play()
local camera = workspace.CurrentCamera
local rayorigin = camera.CFrame.Position
local rayDirection = camera.CFrame.LookVector * 100
local rayparams = RaycastParams.new()
rayparams.FilterDescendantsInstances = {player.Character, player.Character.sword}
rayparams.FilterType = Enum.RaycastFilterType.Exclude
wait(1.5)
local rayresults = workspace:Raycast(rayorigin, rayDirection, rayparams)
if rayresults and (rayresults.Instance.Parent == workspace.BossModel or rayresults.Instance.Parent.Parent == workspace.BossModel) then
humanoid.RootPart.CFrame = CFrame.new(workspace.BossModel.Torso.Position) * CFrame.new(-10,0,-2)
local loadedCutp2 = player.Character.Humanoid:LoadAnimation(cutp2)
loadedCutp2:Play()
wait(2)
else
print("no results")
end
player.Character.Humanoid.WalkSpeed = 16
wait(debounce)
debouncewait = false
end
end
Check the output, it may output cannot load sanitized id. Unfortunately, I’ve encountered this problem many times, and its just a roblox thing tbh. I’ve heard its because under a different group or something, but there’s really no documentation on it that I could find atleast. One of the reasons why I quit Roblox ngl. Good luck on your game!
Hello, we have released an improvement to the error reporting when animations failed to load. It should provide additional context that will help you (and us) debug the specific issue.
Honestly, I forgot I replied to this post lol. Unfortunately I am not working on the game (or any games) anymore as I quit to the exact problem you have fixed (and some others).
Thank you so much though, I appreciate you making future developers have a better experience with Roblox as a whole and be able to create games that they have dreamed upon.