I’m trying to make a custom humanoid. Got it all working and good with movement, then removed the humanoid.
I noticed that the mob falls until the humanoidrootpart is touching the ground, and that it could flip due to collision with other parts. As seen here it flipped due to falling.
https://gyazo.com/59012534fcb5daf04cc1823ddd2b6a89
How would I be able to keep the humanoidrootpart floating above the ground by the hiphieght length to keep it from rotating up and down and have the mob not underground?
game.Players.LocalPlayer.Character.Humanoid.HipHeight = 1 -- Any Number
Yeah but im working with custom humanoids. No humanoid class no hipheight.
Few ways i can come up:
-
Have rootpart handle all collisions, so you don’t have to worry about for it to be at consistent height from the ground (world zero’s custom humanoid works like this with rootpart acting as whole body. the rig is just for visual that is locally handled. In easier words every mobs / character in their game is a tall cylinder on server lol)
-
Shoot ray downwards every frame, and adjust the force to be at the right height (Luanoid by lpghatguy does this i think)
This is working well, but how to avoid tripping over? As in the cylinder tripping over a rock or something
I myself haven’t fully came up with this problem, but I am guessing you can apply a jolt of force to push the humanoid up the bump forcefully when it hits one (requires constant raycasting).
It is my understanding that one of the forces a Roblox Humanoid applies on itself is a self-righting force that acts against angular changes other than the Y angle. You could check for the instantaneous change of the Orientation of the HumanoidRootPart and use that to determine what reactionary action to take, for example. Theoretically, if you combine this pseudo-gyro with shooting a ray downwards and adjusting the force of your cylinder, and perhaps increasing the force if significant resistance is met in terms of the angular change of the HumanoidRootPart, you should be able to navigate over obstacles like that.
EDIT: Out of curiosity, why custom Humanoids?
I’m working on an npcs system (more like mobs) thus with huge numbers of mobs in a single place it creates alot of lag. Even though I’m sure the code is efficient enough. Thus the bottle necking source seems to be from the humanoids, as many have mentioned before.
hi . I know this post is really old but may i know how to calculate the force?