How to make an character unmoveable but not anchored?

I’m trying to make an animation thing on a NPC, but the NPC can be moved, so how would I make it so that is can’t be moved, but keep playing the animation?

Anchor its HumanoidRootPart. Animations should be able to be played while it is anchored.

Here is an example of me with my own HumanoidRootPart being anchored while playing the “Heisman Pose” animation.

image

5 Likes

Thanks, sorry for the late reply.

		-- Freeze player
		local ContextActionService = game:GetService("ContextActionService")
		local FREEZE_ACTION = "freezeMovement"
		
		
		
		
		-- temporarily freeze the player
		ContextActionService:BindAction(
		    FREEZE_ACTION,
		    function()
		        return Enum.ContextActionResult.Sink
		    end,
		    false,
		    unpack(Enum.PlayerActions:GetEnumItems())
		)
		
		
		-- release the player from being frozen
		ContextActionService:UnbindAction(FREEZE_ACTION)