Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Humanoid always falls when Unanchored?

I have a zombie which is anchored when spawned, but after 3 seconds it gets unanchored and just falls down. I want the zombie to instantly start walking when he gets unanchored. I am trying to make an animation, where a zombie comes up from the ground, like in the game Zombie Attack. This is the code I have now:

function SpawnZombie()
	local zombieTorso = script.Parent.HumanoidRootPart
	
	--zombieTorso.Anchored = true
	script.Parent.Torso.CanCollide = false
	script.Parent["Left Leg"].CanCollide = false
	script.Parent["Right Leg"].CanCollide = false
	
	for i = -5.5, 4.5 do
		zombieTorso.CFrame = CFrame.new(zombieTorso.Position.x, i, zombieTorso.Position.y)
		wait(0.1)
	end

	--zombieTorso.Anchored = false
	script.Parent.Torso.CanCollide = false
	script.Parent["Left Leg"].CanCollide = true
	script.Parent["Right Leg"].CanCollide = true
	
	zombie:MoveTo(Vector3.new(0, 0, 0))
end

2 answers

Make sure the CanCollide Property is set to true in each part of the zombie.

Also, to make any humanoid walk, you would to use the MoveTo function of Model.

Model:MoveTo(positionwhereyouwanthimtomove)

9 comments

0

I know how to make it walk, but after I unanchor the zombie it just falls down and after a few seconds starts to walk

0

If the CanCollide property is set to true, then i'd recommend sending your code in the question.

0

Have you tried placing the zombie in the ground?

0

Yes, the zombie always falls down.

0

Maybe it's the code then, I don't know, since I can't see the code.

0

You can check the code now.

0

Can we see the whole script?

0

There is nothing else that controls the zombie in the script

This discussion is preserved as it was. New answers, comments, and votes are closed.