FREEZING PLAYER ANIMATIONS
I mean
How can I do it?
More so like… instead of “freezing”, temporarily stopping? Because “freezing” could be mistaken for pausing, anchoring, or, you know, all that stuff, when what I ACTUALLY want is…
I mean, the problem is when you’re holding WAS or D, and I anchor your humanoid root part, you’re still, like… the walk animation still plays…? And I want the player to return to a neutral position, just kinda sitting there. Like their idle animation. I don’t want the walking to resume when I unanchor them either, I just want it to be normal and only play when they’re walking again (As I said, like normal).
NPC JUMPING WHEN I UNANCHOR IT
So, I’m doing basically the same thing for the NPC? I make it walk towards you and anchor it in place when it reaches it’s destination. And everything works fine, it’s nothing game breaking, just a little weird when I unanchor the NPC’s humanoid root part and they just kinda… jump? For some reason?
Here’s the code that handles both, answer one problem, or both, either helps. Thanks.
local npc = script.Parent.Parent
plr.Character:SetPrimaryPartCFrame(CFrame.lookAt(plr.Character.HumanoidRootPart.Position, npc.HumanoidRootPart.Position - Vector3.new(0, plr.Character.HumanoidRootPart.Position.Y - npc.HumanoidRootPart.Position.Y,0))) --I know this line is confusing and long but it's just making the player look at the npc
plr.Character:SetPrimaryPartCFrame(plr.Character.PrimaryPart.CFrame * CFrame.new(0,1.5,0)) --doing the previous method sticks em in the floor, this makes em move up enough to be on the ground
local plrAnimations = plr.Character.Humanoid.Animator:GetPlayingAnimationTracks()
for i, plrAnimation in pairs(plrAnimations) do --my attempt at force stopping player animations, doesn't seem to work... it used to but it would permanently stop so I don't know what happened
plrAnimation:Stop()
end
plr.Character.Humanoid.AutoRotate = false
plr.Character.HumanoidRootPart.Anchored = true
npc.Move.Disabled = true --This is a wander script I have inside the NPC, disabled as I don't want it to move randomly)
npc.Humanoid:MoveTo((plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5)).p)
npc.Humanoid.MoveToFinished:Wait()
wait() --this all makes the NPC move to the player, then wait until they're in position before anchoring them
npc.HumanoidRootPart.Anchored = true