I’m working on a character controller inspired by Evade’s and Nico’s Nexbots’ controllers, which are both based on the Source engine’s controller. Currently, I’m using a custom collision mesh (a capsule) for the movement physics, which is attached to the character’s HumanoidRootPart. To ensure that the capsule collision remains stable and doesn’t flip over, I’ve implemented a BodyGyro that keeps the capsule’s rotation constant. However, I’ve noticed that if the capsule’s rotation is forcibly changed (such as by colliding with another object), it no longer corrects to its original rotation. I’m not sure what’s causing this issue.
Here’s a quick video to demonstrate the issue:
The BodyGyro’s properties look like this:
Also yes i tried using the new constraints, but either it didn’t work or I just don’t know how to use them.
The humanoid uses the HumanoidRootPart as the “default controller”, i don’t want to delete the humanoid because if i do then the player’s avatar will not load
Yes, thats what i did, but I’m setting the Humanoid’s PlatformStand value to “true” so the HumanoidRootPart can rotate, so the HumanoidRootPart is just being used to weld the custom collision mesh to the player’s character
It sounds like you’re working on a character controller using a custom collision mesh and a BodyGyro to keep the capsule’s rotation constant. However, you’ve noticed that if the capsule’s rotation is forcibly changed, it no longer corrects to its original rotation.
One possible cause of this issue could be that the BodyGyro’s MaxTorque property is set too low. The MaxTorque property determines the maximum amount of torque that can be applied by the BodyGyro to rotate the part. If it’s set too low, the BodyGyro may not have enough torque to correct the capsule’s rotation when it’s forcibly changed.
Here’s an example script that sets the MaxTorque property of a BodyGyro to a high value:
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
You could try increasing the MaxTorque property of your BodyGyro and see if that helps resolve the issue.
this may be redundant, but set the player’s humanoidstate on the client to Physics, not platform stand. And disable all other humanoidstates so its forced to be on Physics. if it still doesn’t work then the BodyGyro itself may be too weak as @SilentDevReal said.
Umm, shouldn’t your BodyGyro MaxTorque be set to (math.huge, 0, math.huge) so the Y orientation allows you to rotate your Humanoid, but the gyro keeps it upright.
I tried setting the HumanoidState to physics, as well as setting the bodyGyro MaxTorque to math.huge but it didn’t fix the issue, it kinda just allowed me to clip through walls
also what @Scottifly said is true too, try setting the X and Z to math.huge but not the Y. im not available to tinker with this in studios atm but if you dont have a solution when i am able to ill attempt a more hands on approach to assist