Hello. I am trying to freeze the animation at a specific spot when the player goes near the NPC. The animation works but it doesn't freeze at the marker I put.
Script:
local Players = game:GetService("Players")
local Main = script.Parent local Humanoid = Main:FindFirstChildOfClass("Humanoid")
local Range = 26 -- Range local Check = true -- Debouncer
local PlayAnimation = function(AnimationID) local Animation = Instance.new("Animation") Animation.AnimationId = ("rbxassetid://%s"):format(AnimationID)
local Track = Humanoid:LoadAnimation(Animation)
Track:Play()
end
while wait() and Check do for _,Player in next, Players:GetPlayers() do local Char = Player.Character or Player.CharacterAdded:wait() local HumanoidRootPart = Char:FindFirstChild('HumanoidRootPart') local A,B = HumanoidRootPart.Position, Main.HumanoidRootPart.Position
local Dist = (A - B).Magnitude
if Dist <= Range then
PlayAnimation(6952695615)
Check = false
wait(55)
Check = true
end
end
end
PlayAnimation:GetMarkerReachedSignal("Freeze"):Connect(function() PlayAnimation:AdjustSpeed(0) end)

1 comment
you can anchor an npc once it touches the specific part