Tower Defense: Height

So I’m trying to make a tower defense right now. And I was wondering how I would be able to add custom hipheight system to where the enemies don’t levitate and are always on the group whenever walking. I heard of a car suspension system that would work.

But I still don’t know how that would work with humanoid root parts because I have smaller and taller enemies. Here is a video on what my enemies look like and would love to know how I could fix this issue.

1 Like

Hello, I got it to work. But if anyone is needing help I can teach it here real quick.

So for the first variables I got was the HumanoidRootPart and the hipheight, which could be anything. Using the model’s Left Leg would work perfectly. I also calculated the direction from the root part to the ground by 5 studs cause I don’t think enemies would get any taller than 5 studs.
image

After that I got root part’s size and the raycast params I will be using later.

Lastly I raycasted and got the distance of the raycast from the part to the ground which I then did the calculations to get the adjusted height of the hip height.

The formula I used:

distanceFromGround - (rootHeight [rootpart.Size.Y] / 2 + hipHeight [LeftLeg.Size.Y])

Anyway that’s it I got it to work pretty easy from how Roblox worked their hip height on the humanoids’ page.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.