Animation Problem on floating character

I have a game system where the player sits using a sit animation. It works by anchoring the character and setting their CFrame to match the chair’s CFrame.

I created an animation and tried to play it, but it does absolutely nothing.

function GameMain:PlayIdleAnimation(plr: Player)
	local character = plr.Character

	local humanoid = character.Humanoid
	local animator: Animator = humanoid.Animator

	local anim = Instance.new("Animation")
	anim.AnimationId = "rbxassetid://id"

	local track = animator:LoadAnimation(anim)
	track.Looped = true
	track:Play()
	self:FindPlayerInTable(plr)[7] = track
end

What am I doing wrong?

2 Likes

set the animation priority to action

When a character is anchored the animation won’t play. Try welding it instead

1 Like

Unfortunately, didn’t worked. Tried from both animation and script

1 Like

you should just put a seat object inside of the chair so the player can sit if they walk over it without needing to create a script for it also if you have a custom sitting animation you should change it inside of the players animate script

How will I be able to sit them by teleporting them?

1 Like

if you want to force the player to sit on the chair you can use the :Sit() function

local humanoid = character.Humanoid
local seatobject = (ur seat object)

seatobject:Sit(humanoid)

1 Like

I’ll try that tomorrow and will let you know if it worked or not, thanks.

1 Like

dont spread misinformation please

Try:

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://id"

function GameMain:PlayIdleAnimation(plr: Player)
	local character = plr.Character

	local humanoid = character.Humanoid
	local animator: Animator = humanoid.Animator
	local track = animator:LoadAnimation(anim)
	track.Priority=Enum.AnimationPriority.Action
	track.Looped = true
	track:Play()
	self:FindPlayerInTable(plr)[7] = track
end

Animator script does play own animations hence why
Action priority should override them

Animations can’t play when the humanoidrootpart is anchored it’s not misinformation

i checked a bit ago by anchoring my humanoidrootpart, the animations played

Not to look egotistical, but firstly, you are completely wrong and do spread misinformation.
Second of all, I know the behavior of animations better than you know how to speak without multiple mistakes in a sentence.

its okay people make mistakes you dont have to be rude

1 Like

animations don’t have any hardcodded behavior that ties to a root of joint being anchored.
The hell you are yapping about?
All animations do is update Transform property (internally) on a Motor6D/Bone

1 Like

Wouldn’t the animation just not work ? sure the moter/bone pos will still get updated but visually speaking it wouldn’t show the animation playing

Sorry for late reply, making it to sit seems to be more reliable solution.

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