Help making a custom HipHeight system

Hello! I think the title is self-explanatory, however I’ll explain the issue below either way.

The issue

I’m making a custom character rig without a humanoid however, I’ve came across an issue where the rig is partially inside the floor. I’ll have a picture of what I mean below if you’re still confused.

image

Yes, I did try to look for posts with the same issue although, all the posts either have no replies or nothing that would help. I’ve also tried using AlignPosition/BodyPosition, but it doesn’t work well with momentum.

Do the legs have collisions enabled?

1 Like

No, I though I’d need to disable collision because it would mess up some animations

No, all rigs body parts should have collisions enabled.

1 Like

Roblox’s default R6 rig has no collision, and I doing that before however for some reason I was able to climb up walls for a short period of time.

You can attempt to add a thin part under the legs that have collision and weld them to the legs so they move with the legs

1 Like

This might work, but is there any way to make a system close to Roblox’s humanoid?

not to my knowledge but you can create a script with a couple number values and if the hp is 0 or less then break all the welds, waits a couple seconds and loadcharacter, then use velocity for jumping etc

1 Like

Yeah you raycast downwards, but what’s the point in doing this? Humanoids have a hipheight already.

1 Like

I already plan to add velocity for jumping, but I’ll try this later

1 Like

actually you can weld this to the humanoid root part or whatever your main part is so they dont rotate with the legs which should make it work better

1 Like

It’s for a custom humanoid rig, I want to have full control of the movement and so it causes less lag

you would prob need a custom animator since you dont have a humanoid

1 Like

Roblox has a system for this I believe, Animation Controller

1 Like

idk im not a animator though i never really messed with animations

1 Like

I’m against doing something like that but the way it’s generally done is you call workspace:Raycast(origin, direction, params).

local HRP -- humanoid root part
local params = RaycastParams.new()
-- edit params to exclude self
local result = workspace:Raycast(HRP.Position, -Vector3.yAxis * 10, params)
if result then
  local bottom = result.Position + Vector3.new(0, hipheight, 0)
end

Something like this usually for each frame so you usually tie it to PreSimulation or PostSimulation.

If you don’t have a humanoid you can still use AnimationController.

2 Likes

You can also use tweenservice and cframe animations if this doesnt work for some reason

1 Like

I know how to get the position of the floor, the issue is how can I align the RootPart without messing up any velocity. Also I want a explanation if you can

i mean you can try setting the CFrame directly but that could screw with walking and jumping

1 Like

Which is why I made this post, how EXACTLY can I fix that, the part system you mentioned sounds like a good method though still havent tried it

1 Like