Script Animation works in Local Server but not in Team Create or Published Game

Hey Guys, here’s my issue.

When a player interacts with a proximity prompt, it should play the animation ON the person interacting with it. However, make sure everyone else on the server can see the animation happening to the person.

Now, it works when I try it on a local server with 2 players in Roblox Studio. Though when in team create and in the actual published game, it doesn’t seem to want to work at all. No animation is shown to anyone. How could this be if it worked in a 2 Player Local test Server?

Here is my code for a LocalScript under the Proximity Prompt which is under the Mesh Part.

local LiftEvent = game.ReplicatedStorage:WaitForChild("LiftEvent")
local prompt = script.Parent

local function onPromptTriggered()
	LiftEvent:FireServer()
end

prompt.Triggered:Connect(onPromptTriggered)

LiftEvent.OnClientEvent:Connect(function()
	local character = game.Players.LocalPlayer.Character
	if character then
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			local animation = Instance.new("Animation")
			animation.AnimationId = "rbxassetid://5518924930"
			local track = humanoid:LoadAnimation(animation)
			track:Play()
		end
	end
end)

Here is my code in a regular script in ServerScriptService

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LiftEvent = Instance.new("RemoteEvent")
LiftEvent.Name = "LiftEvent"
LiftEvent.Parent = ReplicatedStorage

function onLiftEvent(player)
	local character = player.Character
	if character then
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			local animation = Instance.new("Animation")
			animation.AnimationId = "rbxassetid://5518924930"
			local track = humanoid:LoadAnimation(animation)
			track:Play()
		end
	end
end

LiftEvent.OnServerEvent:Connect(onLiftEvent)

And finally here is my code in a LocalScript in StarterPlayerScripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LiftEvent = ReplicatedStorage:WaitForChild("LiftEvent")
local ProximityPrompt = game.Workspace.CWC.CupMesh.ProximityPrompt

ProximityPrompt.Triggered:Connect(function()
	LiftEvent:FireServer()
end)

This animation is a test Animation just until I get this mechanism working, then I aim to create an animation where the player lifts up a trophy, (which I am still trying to figure out).

1 Like

Is this game under a group or is it under your player?

If your game is under a group then the animation needs to also be published under a group or else only you will be able to see since its published under you.

1 Like

Make sure the scripts are committed

It’s under a different player, I’m just in the Team Create.

That was a problem before but they are committed and didn’t turn out to be the issue.

Is there anything different in the console?

I believe its due to a known issue with animations that essentially other developers on your team create cannot see/interact with your animations unless they publish it themselves. The only way to ensure an animation works properly in-game is if the animation is published by the same person who owns the game.

The way around this is by making a group game and having group animations. Theres essentially a safety on animations to prevent people exposing each other to innapropiate animations.

2 Likes

Thanks a lot for the reply! I’ll see if I can create a manual animation for the game then.

1 Like

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