My custom animation isn't playing

1 Like

You need to load the animation into a humanoid before you can play it. See Animator | Roblox Creator Documentation

2 Likes

is there an example with an proxmitiyprompt?

Yes, here you go:

local Part = script.Parent
local ProximityPrompt = Part.Attachment.ProximityPrompt

local Animation = game.ReplicatedStorage.Animation

ProximityPrompt.Triggered:connect(function(Player)
	local Character = Player.Character
	local Animator = Player.Character:FindFirstChildOfClass("Humanoid").Animator
	
	local LoadedAnimation = Animator:LoadAnimation(Animation)
	
	LoadedAnimation:Play()
end)
1 Like

that made it so the script i made, which is an “Sound playing” “Animation Playing” “And Point giving” script, that it gets an bit confusing, anyways it didn’t work now the thing isn’t working. Is the "Local proximitiyPrompt = part.attachment.Proximityprompt, Mandatory, if you already have

It’s not mandatory, you can change the variables to whatever you are using.

The code I’m using (Below) doesnt work, is there anything blocking the animation from playing, Cause it is in replicated storage, and the script is really cramped aswell, i might of mispelled some things, but yeah, can you test or try to fix this code, to see if it will work somehow, if you can/and/or/want to, I don’t wanna annoy people for the sake of me being an idiot.



local part = script.Parent
local animation = workspace.Animation --[eee]--green--text--or--'amogus'

local sound = workspace.PizzaTime1
SoundId = "rbxassetid://4066197235"

local ProximityPrompt = script.Parent.ProximityPrompt
local animationeee = game.ReplicatedStorage.Animationeee

ProximityPrompt.Triggered:Connect(function(player)
	player.leaderstats.Pizzas.Value += 1
	local Character = player.Character
	local Animator = player.Character:FindFirstChildOfClass("Humanoid").Animator
	
	local LoadedAnimation = Animator:LoadAnimation(animationeee)
	
	LoadedAnimation:Play()
	sound:Play()
	
	animation:Play()
end)

Has your animation been uploaded to the Roblox site?

Yes it has been uploaded, it is an simple eating animation, the thing is that nothing happens when i try to eat the pizza, and i dont know if the “Pizza Time” tobey maguire sound plays.

(i say wtf when the video just ends but u cant see)

Video Below with example:
https://gyazo.com/b339c9198e5ea218342c4f7c17b84359

Screenshot evidence:

Can you check the console for errors?

(To open the console, press F9 while play testing, or type /console in the chat.)

"LoadAnimation requires the asset id not to be empty…" (lil fix)

… But why isn’t the thing giving me points then, I’ll try to see if it didn’t have the animation loaded in, but wait…

BTW
It’s not empty…
image
Is it somewhere in the script that needs an “RBXASSETID://” or something?

Well, is your script a LocalScript? If so, try changing it to a Script.

It isn’t an local script, as shown here:
image
So yeah…

1 Like


I also feel like that, local’s dont belong in the proximityprompt:triggered

Why?

Cause there not ment to be ther u sussy baka
are they

1 Like

I just don’t see any errors, are you sure you’re looking at the right animation?

1 Like

It’s the only animation. … :lying_face: :confused: P.S: I’m using an custom rig, And i copy and pasted your code in and it didnt work still…

1 Like

I have tested your code myself and it works for me, so it might just be a problem with your animation.

1 Like

Do you have an place file that I can take an look at.

1 Like

Is it because I’m using an custom spider-man rig, Without the spider-man rig, the game will be kinda messed up, because i need it to make the pizza time epik.

Replication.rbxl (25.2 KB)
Here is a replication of your game that I have tried.