I’m having a really weird issue, where the HumanoidRootPart of an NPC won’t unanchor, but print says it is set to false…
Im trying to make a mechanic where if the NPC dies, the root part is anchored (so the body doesnt get flinged around), an animation is played, the root part is unanchored and then the character ragdolls.
It all works perfectly, except for the unanchoring part. the root part just refuses to unanchor, but trying to print the state of it says its false.
humanoid.Died:Connect(function()
if script.Parent:FindFirstChild("Head") then
char.HumanoidRootPart.Anchored = true
DeathAnim1:Play()
wait(1)
humanoid.PlatformStand = true
char.HumanoidRootPart.Anchored = false
Ragdoll()
else
char.HumanoidRootPart.Anchored = true
decapitation:Play()
wait(1)
char.HumanoidRootPart.Anchored = false
print(char.HumanoidRootPart.Anchored)
Ragdoll()
end
end)
this is the block of code. (it also detects whether the character has a head, for a different animation but that shouldnt cause the issue)
I have a theory as to why this happens, being that this function is called a bunch of times when the char dies because the anchored state is printed various times, and it only prints when its unanchored, (however the root part is visibly always anchored, and checking the browser while playing always shows its anchored) but I got no clue how i’d stop that from happening. any help is appreciated
Can you tell me is the script a localscript or server script? Are you checking the npc humanoidrootpart anchored state on server explorer or client explorer?
its a server script in the NPC model. I’m not sure how to know which explorer I was using, but I’m assuming its whats on the “Current” thing on the Test tab, and both were anchored