MarkaHouD
(MarkaDev)
September 22, 2025, 6:45pm
1
I’m facing an issue with my NPC system. When spawning an NPC, there’s a chance that it spawns partially inside the ground. As a result, the NPC gets “stuck” and starts walking in an incorrect animation state, as if it’s sunk into the ground
I’ve already tried spawning the NPC a few studs above the ground (e.g., 3 studs higher), Delaying AI + Animate for ~1.5s after cloning., but the issue still happens randomly.
for i=setings.KillersPerWave,1,-1 do
local killer:Model = randomKiller:Clone()
killer.Parent = workspace.KillersHolder
killer:PivotTo(spawnPart.CFrame * CFrame.new(0,3,0) * CFrame.new(math.random(-10,10),0,math.random(-10,10)))
local aiScript = script.Ai:Clone()
aiScript.Parent = killer
local animateScript = script.Animate:Clone()
animateScript.Parent = killer
task.delay(1.5,function()
aiScript.Enabled = true
animateScript.Enabled = true
end)
task.wait(setings.KillerSpawnKD)
end
mbtae1238
(Redacted)
September 22, 2025, 7:09pm
2
MarkaDev:
CFrame.new(0,3,0)
Maybe try to increase the Y axis ?
Scottifly
(Scottifly)
September 22, 2025, 7:29pm
3
MarkaDev:
killer.Parent = workspace.KillersHolder
killer:PivotTo(spawnPart.CFrame * CFrame.new(0,3,0) * CFrame.new(math.random(-10,10),0,math.random(-10,10)))
Try switching these 2 lines. You’re putting it into the workspace first, then moving it.
Move it’s location, then put it in the workspace.
1 Like
By the looks of it, is your killer a custom player model? If so, have you tried adjusting the hip height ?
Scottifly
(Scottifly)
September 22, 2025, 9:42pm
5
The HipHeight is probably ok since it’s only happening once in a while. If it got stuck every time I’d suspect it was the issue.
MarkaHouD
(MarkaDev)
September 24, 2025, 8:46am
6
yeah its the only way to make the corrupted bot walk properly by adjusting a hip height. But how i could detect which of the bots is bugged
Scottifly
(Scottifly)
September 24, 2025, 5:10pm
7
Like I said above, I don’t think it’s a HipHeight issue if they walk normally most of the time.