Enemies's foot clipping trough the floor

Hey! so im making a tower defense game and im running into a building issue that the enemy’s foot keeps clipping trough the floor

I already tried changing the hip height, everything i could find on the devforum but it didnt work. Can anyone help me?

Heres an image
Screenshot_137

2 Likes

for a tower defense game you shouldn’t need to use humanoids for the models anyway.

Why not try tweening the model between the points you need it to travel along the path?

local TS = game:GetService("TweenService")
local All Movements = {}
local function Move (Object, CF, Speed)
	local TI = TweenInfo.new(Speed,Enum.EasingStyle.Linear)
	local CFrame = Instance.new("CFrameValue")
	CFrame.Value = Object:GetPivot()
	CFrame:GetPropertyChangedSignal("Value"):Connect(function()
		Object:PivotTo(CFrame.Value)
	end)
	local T = TS:Create(CFrame,TI,{Value = CF})
	T:Play()
	T.Completed:Connect(function()
		CFrame:Destroy()
	end)
end

You can use this function to move the model between two points.
Object is the model.
CF is the CFrame of the position you need it to move to.
Speed is how fast you want it to move there.
Example:

Move(MobModel, PathPosition1.CFrame, 2)

Im using humanoids because they make the zombies look cooler and also im pretty sure most td games use it lol, and im tweening the path the zombies make, but the issue is they are clipping trough the floor, and i need help with that

Thanks anyway!

they shouldnt clip through the floor if the positions you are tweening the model between dont allow it to reach the floor.

Is the model anchored?
While you respond I will make an actual example so you can see what I mean.

It wasnt anchored, but now that i anchored it it just doesnt moves and still clips trought the ground : /

Alright then it seems like you didn’t understand what I was suggesting, I will finish making an example for you to see.

You don’t want to keep them anchored. Second of all, you’ll want to raise the point as to where they spawn. If you are teleporting them into the map, it goes by the root part position.

1 Like

Try printing the start and finish positions of each tween. If they end up at the surface of the baseplate then just raise the Position by +2.

Im parenting then to the enemies folder on workspace and adding a + Vector3.new(0,2,0) at the end, but they just fall and dont collide with the map, its kinda weird bc the map has collision enabled

I found out a solution, the problem was that the block the npc follows were not anchored so they kept falling, now i fixed it but thanks for the help! :slight_smile:

I’m not sure if you noticed, but that was my second suggestion.
I thought you might not have understood what I meant, so I was going to go make an example game to make sure you understood everything I was saying by using a visual representation.

I’m not sure if its any use to you, but since I stopped typing out that reply half way though. I will just send you a gif I recorded in case you get any inspiration from it.

Good luck with your project!

Ohhh i tought it was the model of the zombie lol, i think i actually got some thx! :slight_smile: