Is Moon Animator broken?

I am in this game trying to make a animation with a arm sticking out when i put it into this chair it makes the arm curve here is the script note its in a chair with the animation:

seat = script.Parent
function added(child)
if (child.className==“Weld”) then
human = child.part1.Parent:FindFirstChild(“Humanoid”)
if human ~= nil then
anim = human:LoadAnimation(seat.sitanim)
anim:Play()
end
end
end

function removed(child2)
if anim ~= nil then
anim:Stop()
anim:Remove()
end
end

seat.ChildAdded:connect(added)
seat.ChildRemoved:connect(removed)

If you could do this:
image

That would help us a lot.

Edit: The line is the typing symbol/effect.

@Dev_LandonRB This also needs to be in scripting support.

2 Likes

Its about moon animator. :grinning_face_with_smiling_eyes:

Is this the entire script? If not, pleases show us the entire script, or anything relating to this code.

Anything related to scripting support goes inside of scripting support, even if you’re using it for something like art design. (correct me if I’m wrong)

It is the entire script, sorry for trying to correct you.

1 Like

Oh, I see. Do you have the output open? If not, you can find it under View and then to Output

you did nothing wrong btw lol

Nothing pops up about it. :grinning_face_with_smiling_eyes:

2 Likes

Just to clear some things up. When you put the arm inside the chair in explorer, it makes the arm curved? But when its outside of the chair, its not curved?

Ok, I make the animation in moon animator with the arm sticking out and the middle of the arm (which is r15) it is curved

1 Like

Is this in a server script and inside an animation Instance?

its in a seat and the animation is in the seat

1 Like

This should work if you put your animation in there.

local seat = script.Parent
local seatanim = --your animation
local anim

local function added()
	if seat:FindFirstChildOfClass("Weld") then
		local child = seat:FindFirstChildOfClass("Weld")
		local human = child.Part1.Parent:FindFirstChild("Humanoid")
		if human ~= nil then
			anim = human:LoadAnimation(seatanim)
			anim:Play()
		end
	end
end

local function removed()
	if anim ~= nil then
		anim:Stop()
		anim:Remove()
	end
end

seat.ChildAdded:Connect(function()
	added()
end)

seat.ChildRemoved:Connect(function()
	removed()
end)

tysm! :grinning_face_with_smiling_eyes:

1 Like

No problem! If this fixed your problem pls mark as solution!

:smiley:

It did not work, the animation does not play.

Bah-

Alright well back to work.

I think it’s because we need to override the animation to make sure it plays.

Well i made the animation play but the arm is still broken

1 Like

Is the animation priority set to action? If it isn’t, set it to action and try again.

1 Like

Sorry for late response. I’m not used to using seats.

Script

local seat = script.Parent
local seatanim = seat.Animation1

local function added()
	if seat:FindFirstChildOfClass("Weld") then
		local child = seat:FindFirstChildOfClass("Weld")
		local human = child.Part1.Parent:FindFirstChild("Humanoid")
		if human ~= nil then
			local char = human.Parent
			local plr = game.Players:GetPlayerFromCharacter(char)
			local sitanimation = human.Parent.Animate.sit.SitAnim
			local oldsitanimation = "http://www.roblox.com/asset/?id=2506281703"
			sitanimation.AnimationId = seatanim.AnimationId
			wait(1)
			game.ReplicatedStorage.RemoteEvent:FireClient(plr, oldsitanimation)
		end
	end
end

seat.ChildAdded:Connect(function()
	added()
end)

Local Script (parented to PlayerGui)

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local human = char:WaitForChild("Humanoid")

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(oldanim)
	local AnimationTracks = char.Humanoid:GetPlayingAnimationTracks()
	for i, v in pairs(AnimationTracks) do
		v:Stop()
	end
	char.Animate.sit.SitAnim.AnimationId = oldanim
	local sitanim = char.Animate.sit.SitAnim
	local newanim = human:LoadAnimation(sitanim)
	newanim:Play()
	newanim.Looped = true
end)

Create a remote event and name it “Remote” and parent it to ReplicatedStorage

:sleeping_bed:

Tbh, i dont like using the roblox animator because the rotation is not as good as moon.

1 Like