I currently have a very weird problem. Im helping this kid script a phone in return for a payment, so were doing it in team create. But right now im having this very weird issue where an animation fails to load on the player. I had uploaded the animation, and then the animation would only load on me, but not on the other kid that i was helping. Then we tried to fix this by letting him upload the animation, but then we had the exact same problem, where i couldnt use the animation. We tried testing in a normal server, and then the animation would load on neither of us. The code looks something like this:
local animation = nil
script.Parent.Click.ClickDetector.MouseClick:connect(function(plr)
if (plr.Character.Head.Position - script.Parent.Main.Position).Magnitude < 5 then
animation = plr.Character.Humanoid:LoadAnimation(script.Calling)
animation:Play()
else
if animation then
animation:Stop()
end
animation = nil
end
end)
In the original full code everything works as intended, its just that the animation wont load. So i dont think that its something to do with my code.
An error message would be helpful. It could be because the other person doesn’t have permissions to use the animation, the animation was moderated, or the other person’s Roblox cache is broken and needs to be cleared. I’m leaning towards the first one.
You said that your assets don’t load for you on an online server, right? Try closing all instances of studio and deleting C:\Users\<your username>\AppData\Local\Temp\Roblox (your Roblox cache) and see if that fixes thae problem for you. If it works for you, then instruct the other person to delete their cache, too.
Deleting the cache shouldn’t cause any problems, but to be extra-safe, make a backup of it. Make sure to delete the folder named Roblox itself. Don’t just delete its contents.
EDIT: If you not convinced that it’s safe, then try enabling the following setting and restarting studio:
From what I tested, this does almost the exact same thing. Instead of deleting the entire Roblox folder, it just clears out ContentProvider and ContentProviderStudio, which is less overkill than what I suggested.
Where are you testing this online? Is it at your place or at their place? If you’re testing it on one of the places they own, then try testing the animation on one of your places instead and see if it works. If it works on one of your places, then it’s likely that they don’t have permission to use the animation.
update: when i try to let the other kid do the exact same thing it doesnt work.
update2: we dont know exactly what we did, but it works now. Im going to post about this in the bug section of forunms
Yeah, I had this issue. Team create version of my game was owned by me, live version by the group. Had to scramble to reupload every animation on launch when none of it worked!
As previous users said it could always be because you or the group place don’t own the animation! Make sure the creator of the team create owns the animation.
I would see if the animation works while in play mode, if it does then that means its a valid animation but you don’t own it.
If you don’t own it but a group of yours does you can always take the animation, import it from the group, and export it to your inventory.
I tried following all those steps, and it seems my animations still ain’t working. There are no errors in the console, and both the game and the animations are owned by the group. Is there anything wrong I’m doing?
Here is the script:
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
repeat
wait()
until Player.CharacterAdded:Wait()
local Tool = script.Parent
local Animations = Tool:WaitForChild("Animations")
local Events = Tool:WaitForChild("Events")
local Sounds = Tool:WaitForChild("Sounds")
--//Sounds
local EquipSound = Sounds.EquipSound
local OverheadSound = Sounds.OverheadSound
local HitSound = Sounds.HitSound
local SwingSound = Sounds.SwingSound
--//Animations
local EquipAnim = Animations.Equip
local Swing1Anim = Animations.Swing1
local Swing2Anim = Animations.Swing2
local MomentumSwingAnim = Animations.MomentumSwing
--//AnimTracks
local EquipTrack = Character.Humanoid:LoadCharacter(EquipAnim)
local Swing1Track = Character.Humanoid:LoadCharacter(Swing1Anim)
local Swing2Track = Character.Humanoid:LoadCharacter(Swing2Anim)
local MomentumSwingTrack = Character.Humanoid:LoadCharacter(MomentumSwingAnim)
local Clicked = false
Tool.Equipped:Connect(function()
EquipSound:Play()
EquipTrack:Play()
end)
Tool.Activated:Connect(function()
if Clicked == false then
Clicked = true
SwingSound:Play()
local Number = math.random(1,2)
if Number == 1 then
Swing1Track:Play()
elseif Number == 2 then
Swing2Track:Play()
end
Clicked = false
end
end)
I’m not surprised it’s not working due to this part:
local Character = Player.Character or Player.CharacterAdded:Wait()
repeat
wait()
until Player.CharacterAdded:Wait()
You’re getting the player’s character properly, but then once you have it, you wait for the CharacterAdded signal again, which either won’t happen or already has. Therefore, your script will wait forever, unless you’re planning on spawning the character a second time during that script’s lifetime.
I recommend you remove that second wait, since you already ensured you got the player’s character.