AlignPosition and Orientation on Collision Box to HumanoidRootPart make the Character "Tilt" on collision, compared to Weld and AlignOrientation

Description

The presence of AlignPosition and AlignOrientation connected with a separate Box onto the HumanoidRootPart causes something strange where the character tilts upon collision, which DOES NOT happen when I utilize Weld. But I can’t use Weld because I need to prevent an Orientation from being changed.

Not only, but if you mess around with Density, the collisions will shake or ping-pong back and forward. And I believe that behavior is related to the tilting.

 

The private message contains a video where I am explaining this strange issue.

Unsure, if this issue is related AlignPosition to HumanoidRootPart, changing Attachment shakes Character, because of ReactionForceEnabled, and I don't know why

Note, I am using the MoverConstraints fix, as it indeed fixes things, e.g. collisions and NetworkOwnership issues.

Re-production Steps

The testing game is also found in the Private Message. But it’s in a separate message.

  1. Go to the testing game
  2. Experiment with the Scripts inside of StarterCharacterScripts by having one of them Enabled. (Either “AlignPos” or “Weld”, not both)
  3. Experiment Collisions by running into the wall.
  4. Observe how Weld doesn’t Tilt the Character, while AlignPos does.

 

Expected Result

A way to not have the character tilt?

It doesn’t tilt with Weld. But I can’t lock/unlock specific Orientations with Weld.

Note that the Weld has a AlignOrientation enabled which purpose is to “Keep Upright” the block. If I don’t do that, the box would tilt as well, the character doesn’t tilt though.

Actual Result

The character tilts upon force being applied onto the wall. And I haven’t figured out why yet. (But the behavior changes if you experiment with Density, the problem is that it’s too hard to control) I thought it had to do with Physics Attributes.

The thing is, this doesn’t happen with the Weld method.

It’s either I find a way to glitch out Orientations not applying on what I am welding the Box onto, or I don’t know. :person_shrugging:

 


A private message is associated with this bug report

Could you try adding an AlignOrientation with the following properties

and set Attachment0 accordingly (you will have to create an Attachment as a child of the HumanoidRootPart oriented with its primary axis pointing towards the sky)?

Does this achieve the desired effect?

1 Like

When I saw the screenshot, I immediately knew this would be a “Keep Upright” type AlignOrientation.

I tried it and it gave me the desired effect. :thinking:

Of course that’s the first impression it gives, I still have my doubts.

I didn’t think about trying that, I thought it would be destructive to alter the HumanoidRootPart.

 

image

I wanted to test water. I learned that I fall through the world. Maybe because of LowerTorso’s Collision Group :pensive:

I do see that if I do apply “Keep Upright” onto the HumanoidRootPart, that it would break default swimming. Since when swimming the HumanoidRootPart’s orientation gets altered.

 

image

 

Infact, all my Collision Groups need to be set to Default… or maybe something that can collide with it… but if I don’t apply all my limbs onto it swimming will feel weird, it’s as if the Swimming Mechanic was made for an Avatar Type, in this case R15.

In the image I do see that it’s creating Contacts for these while in Water.

I don’t even know how the Character Sensors work on Swimming, and whether I need to have the limbs be part of the Default Collision Group as well.

 

Edit:

Alright, I tried Swimming on the default ControllerManager… and… I don’t know…

All that I know is that Roblox changes your Collision Groups when you enter water… the default ControllerManager script doesn’t do that at all, I think that’s something that is missing in the script?

Could you please send a repro of the case where you see the character fall through the world when you enter the water?

1 Like

Added the Water Terrain

https://devforum.roblox.com/t/private-information-bug-report-from-healthykarl/3146625/3

And I turned of the Collision Box script (AlignPos in Starter Scripts), it’s only the Collision Group script that is being altered now.

All you have to do is to walk into the Water placed by Terrain.

 

It is a bit weird and unexpected that this happens, because the character is able to walk on solid ground, but it seems to happen because that’s how the default water works for the Humanoid :person_shrugging:

The Character Controller struggles with that even more without help from Scripts. The LuaCharacterController way more less, but still a little bit.

 

The HumanoidRootPart is always in the Default Collision Group. If I would change that, the Character would fall through Solid Ground as well.

Swimming seems to want something with Collisions being enabled… I think they do enable it but it has no effect since I changed the CollisionGroups of all the Player Aesthetic Parts.

The character is falling through the ground while swimming because your script set CanCollide to false on the HumanoidRootPart. Could you please elaborate on what you are trying to achieve by setting CanCollide to false on the HumanoidRootPart? Is it because you wish to use the red box for collision but do not want the HumanoidRootPart to collide with that red box? If so, you can use a NoCollisionConstraint to explicitly disable collision between the red box and the HumanoidRootPart.

Well, yes.

Use the Red Box for Collision to replace the HumanoidRootPart with. If I give it a NoCollisionConstraint, the HumanoidRootPart will still collide with other things. If the Red Box would be smaller than the HumanoidRootPart it wouldn’t work out.

What I wanted to achieve was to replace the Collisions (in a reliable AABB way) for the entire Humanoid without breaking Roblox Avatars.

This method won’t work out anyways, nor will it work if I use Character Controllers, because they don’t support Ground Offset of 0. When I do that such a character can’t go up things nor fall from platforms.

If you do set CanCollide to false on the HumanoidRootPart but also persist the red box while in water, the character will not fall through the ground. Does this approach suffice?

It works, while I do think something is constantly pulling the box down.

The character doesn’t fall down it gets pulled down, and the box prevents from falling down the world because it is colliding. But swimming up works. This would probably break if I add the “Keep Upright” onto the HumanoidRootPart.

 

The red box that I tried to make was meant to be a modifiable Collision Hull.

 

I understood from the Character Controller, that these things need scripted managers (same for the LuaCharacterController).

The Humanoid from the Roblox Engine has its manager built-in. When I enter Water the Engine enables CanCollide on everything except the Head, without even triggering .Changed.

 

I wanted to replace the Collision Hull for everything from the Humanoid. But the Humanoid toggles things on and off on its own. So without turning off Evaluate State Machine and re-implementing the rest and animations**, it depends how deep one wants to change things.

You can have “Helper Collision Boxes”, that red box is one, because the Red Box can’t touch the floor. But even then it has issues. AlignPosition to HumanoidRootPart, changing Attachment shakes Character, because of ReactionForceEnabled, and I don't know why - #6 by Scottifly

The Humanoid has its own built-in system. It doesn’t expect anyone changing things from the Character. If someone does, they’re expected to adapt it to certain cases. As example, cases where the Humanoid State changes to Swimming.

Similar thing for the Character Controller and the Sensors.

But all of these aren’t sufficient. Character Controller seems to be based of the Humanoid

 

As example, you start of with this:

The Red Block has physics properties, if I clash with a wall it applies those physics.

image

It’s not an AABB because it is rotating. It looks like I can’t escape the requirement of a HumanoidRootPart for Controller Managers either. Roblox seems to be either internally shooting a ray towards the floor as the trace, that has trouble, and changing the Collision Group makes the ray go through or something hence why you fall.

 

Then there’s a case where this happens:

And or the wrong Search Distance lags the game :person_shrugging:

 

Here’s the other test: https://devforum.roblox.com/t/private-information-bug-report-from-healthykarl/3146625/4

Basically, GroundOffset 0 seems to mean no Slope Angle and there’s no MaxSlopeAngle from Humanoid, I think. Regardless though, they both require the GroundOffset to be higher to work in the first place.

 

Character Controllers and the Humanoid rely on things like the HumanoidRootPart and other invisible things.

 

 

While I was trying to achieve a Collision Hull as an AABB.

Other Links

https://github.com/id-Software/Quake/blob/master/qw-qc/defs.qc#L358

“The Collision Hull”
https://github.com/myria666/qMovementDoc/blob/main/Quake_s_Player_Movement.pdf

The player interacts
with the world physically by means of an Axis-Aligned Bounding Box (AABB).
An AABB is a box that remains aligned no matter what, so rotating the players
view by looking around does NOT change the rotation of this box. This is often
referred to as the collision hull, as it is used to calculate collisions.

This box allows one to create accurate places around the World, and precise implementation of Crouching and even more, with almost no workarounds.

Quake/QW/client/pmove.c at master · id-Software/Quake · GitHub

Quake/QW/client/pmove.c at master · id-Software/Quake · GitHub

Quake/QW/client/pmovetst.c at master · id-Software/Quake · GitHub

https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/gamemovement.cpp#L779

If I understand, you would like to implement a custom character movement system. In that case, as you pointed out, you should indeed set Humanoid.EvaluateStateMachine to false. It sounds like you already have an idea for how you want to implement the collision/locomotion portion (i.e. Quake-style), but implementing the visuals (which animations to play, how to transition between them etc…), will also be involved. Unfortunately, I don’t think there is a way around this given your ultimate goal.

Well, on Roblox that wouldn’t be possible in an easy way. Hence why I call them “Helper Collision Boxes”. You implement small toggles that swap out HumanoidRootPart’s collisions or similar temporarily, and when you’d be crouching you’d switch to a different collision box, without interfering a lot.

The only thing that I noticed being strange with AlignPosition was when the Collision Box tilted the player, compared to Weld.

Or when AlignPosition shakes the player when the Attachment is being modified. Meaning one has to put all possible shapes of the Collision Boxes. AlignPosition to HumanoidRootPart, changing Attachment shakes Character, because of ReactionForceEnabled, and I don't know why

 

Summary

In DOORS they use “Capsules” instead of Boxes. Noticeable when the character walks towards the wall, to prevent the camera from clipping through the wall.

And Capsules have a sphere like shape so you can rotate and eventually smoothly go through corners on collisions.

TUNNELER just resizes the HumanoidRootPart. Resizing the HumanoidRootPart causes some things, e.g. WalkSpeed needs to be adjusted and etc. as the main camera script relies on the size of the HumanoidRootPart. Not only but since the main camera script relies on these things, some games are forced to scale all avatars the equal size that rely on the position of the HumanoidRootPart.

 

The LuaCharacterController for crouching just plays an animation that just moves all the limbs lowerer :person_shrugging:

These “limbs” are Aesthetics of the Roblox Avatar, unfortunately they have been used for Collisions :person_shrugging: compared to games where there’s an AABB and one Player Model as the Aesthetics.

 

Someone achieved something Quake style alike, or at least the “Surfing” part. But obviously it is a really crazy approach.

https://www.roblox.com/games/272689493/surf

Noticeable the characters are just being brought to the location the actual player is.

Is the video I recorded something that should happen with the Controller Manager though, or not?

Could you post a RBXL where the lagging happens?

I was trying to reproduce the Gamepaused one, the concept was simple but I couldn’t get it to happen anymore. It was when I changed the SensedPart

I need to retry it from scratch again.

 

For the lagging, it’s the same file like I attached, except that the GroundOffset was set to 2 and the SearchDistance was set to 5.

But I noticed that I only lag if I set the GroundOffset above the SearchDistance and then back to 2.

The reason would be:

image

Even though I don’t have an Animator put… well one was added in automatically. For some reason while this happened I can double jump :person_shrugging: and I don’t know if that’s because the SearchDistance is set to 5.

And when you set it back to 2, when jumping you’d just lag due to that.

This thread has diverged from the initial post, so we will be closing this bug. If the swimming behavior is still an issue, please create a new bug.

1 Like