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
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)