Animation not playing(repost)

This is a repost because I wasn’t getting a replies on my previous post. I made s script for an attack in my game that makes you teleport through the boss if your camera is facing the boss and close enough to the boss. There are two animation parts, the preattack (the character getting ready to attack, will play no matter what) and the attack (plays if your camera is close enough and facing the boss, the animation that isn’t working). Loadedcutp2 is currently set to Action priority but I tried setting it to Action4 but it still did not work.
Heres the script (loadedcutp2 is the animation that doesn’t work)

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

Bumping your topic constantly won’t get you any answers, try providing more details instead, like the explorer hierarchy or something.

(I’m not asking details about your problem, I probably can’t solve it, just saying if you want to bump your topic, provide a piece of new information, someone might read that new information and think of an answer)

3 Likes

Someone please help me find the solution, it is a major part of my game.

dkhjadhjkahdbijwkahbdkahdjua

Maybe you export the animation incorrectly, if you make your game on the Account then Export the animation on the Account not in the group!

My Solution only is, export back the animation where the game belongs to, Account or Group

I have it exported to my account. I’m pretty confident that it’s not a problem with my account because sometimes the animation plays a teeny bit but not very visibly.

Make sure the action property is set to action.

It is, I set in in the roblox animator.

Try through script, and both are the same build right?

Wdym by “both are the same build”?

Never mind, I was able to solve it using a past post;

Ok that’s nice.

Few reminders:

Mark it as a solution. Always search before creating a post. Don’t create new topics, instead bump the topic.

Sorry, i forgot to mark it as a solution, but I’ll remember to search past topics before making my own.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.