[Humanoid/Physics] The ability to create your own collision box and override Humanoid's RootPart one and other behavior

As a Roblox developer, it is currently too hard to create a custom collision for the default R15 Humanoid character controller.

A mention from here.

In most games, the player model is represented by a single mesh, that has animations and etc. the collision of the player can be represented by one single hullbox similar to the AABB.

With only the Hullbox as the collision, it is easily possible to implement Crouch. But not only Crouch, but any kind of thing, even Military Prone positions that is even lower than Crouching.

This includes creating any kind of custom characters, like Spiders or any other sort of thing. With a Hullbox it’s possible to precisely determine a fixed collision box size to walk through things.
 

A Roblox Character, or the R15 by default has 15 parts + the HumanoidRootPart. These parts by default have CanCollide set on true.

I can set all the CanCollide to false. But as soon as I jump, UpperTorso and LowerTorso get CanCollide set back to true.

I can change the CollisionGroup, but it’s not sufficient enough, because the HumanoidRootPart needs to be in the same CollisionGroup as the “floor” it is supposed to collide with or else you will fall through the world. But I can set the RootPart’s CanCollide to false, without falling through the world.

 

So the next proceedor would be to parent a Collision Box.
image

But also this is not really do able because of the Humanoid. If the Collision Box collides with the floor, you just start sliding through the entire Baseplate.

This is not an exact good Hullbox but it demonstrates what it should do.

image

I used AlignOrientation and AlignPosition to fix its size but align it to the HumanoidRootPart. The Collision Hullbox is not allowed to rotate and needs to maintain an upright position at all times.

image

Here’s an example. When I used a WeldConstraint without the Align instances. It would Tilt.
image

You could use a Stadium, to smooth corners but even then, it would tilt anyways.
image

The purpose of the Collision Box is to block any unpassable things 100% the only exception is the floor and maybe a few other things, but the floor.
image

The collision box thing could have worked out. But a few issues occured:

  • Since the collision box is a BasePart, when jumping and landing, you’d bounce back up and are forced to change Elasticity.
  • If you jump up while there’s a ledge above the corner of the collision box, the collision box could glitch out in physics, due to the way I tried doing it.
  • You can’t go up slopes, because you can’t control the Humanoid and it’s RootPart.

image

 

Of course I can resize the HumanoidRootPart, though I think it resizes on its own too…
Setting the HipHeight to 0 makes the player slide, and setting it to 0.01 causes the Hullbox to go up, by a little bit.

And I can’t tell the Humanoid instance that it should do MaxSlope calculations on the custom collision box as well.

Though eitherways, that’s not a true AABB Collision Box.

 

If this issue is addressed, it would improve my development experience because

It would allow to easily implement collision based things + Zone detection as you’d be focusing on one single thing only. But mainly it’s because of the collisions.

The Humanoid and HumanoidRootPart, both assemble something that we can’t see. We can only modify HipHeight and MaxSlope, where upon modifying it, the character just falls down. It is not
precise.

One would have to get rid of the entire Humanoid mechanic and do their own thing. This would mean that you can’t use the default character anymore, nor support HumanoidDescription, which would mean no avatars.
 

The other issue is that Jumping also has its own way. And can’t be changed, like you can change Health by creating a Script.

If it would be possible to tell the Humanoid instance to use a different box just for the collisions, it wouldn’t be bad.

Aslong it stays upright and doesn’t rotate, it is fine.

The reason why it isn’t supposed to rotate, is because if it would, the physics would glitch and the hullbox would not have a purpose.
image image

So if you’d crouch and rotate, your character would glitch, hullbox is always at a fixed origin and orientation.

11 Likes

I’ve done this for my game, simply replace the humaniod root part with a cylindrical mesh

You’ll have to also fix the custom properties like friction it’ll take a while to prefect it

2 Likes

You replaced the HumanoidRootPart? As in completly deleted it, or something in StarterCharacter?

1 Like

I made a cylindrical mesh in blender, it took a while to get the topology correct (if the topology is off it will not be very smooth [when spinning against a wall for example]). Then added it into a starter character, replacing the default humanoid root part

1 Like

but then how would you get it all right with LowerTorso and co.?

1 Like