Jump to content

Character Controller Crouch Step Height


T0X1N
 Share

Recommended Posts

Thank you for posting this article! It really has some great analogy on the character controller and Leadwerk's scaling. Very helpful!

 

This crouch issue is actually a real pain, and I am surprised this issue was not fixed yet since this article is more than a year old and it concerns a pretty crucial part of the engine, character controllers!

 

I will have to avoid using the crouch commands because of the step height. It will be unnatural and a real annoyance to the player that they cannot step on things that is not higher than 8cm, although in my tests, I cannot step on anything above 1cm in height while crouching, which is ridiculous.

 

Now, the problem is, how will I go about going around this issue? I have tried "SetHeight" to the controller, and that does not seem to work. I have tried to set the height to a very small number of 0.0005, and the controller is still not able to fit into an area that was previously accessible using the crouch command. I rather would not to not put up ramps for all of my steps and areas that there is any height differentiation, that will just be a real mess.

 

**** EDIT ****

 

I thought about it for a while and came up with a simpler solution... I will use the crouch command, although, I will only use it if the world tells I have to.

 

So in my program, if the player crouches, it will simulate that the character is crouched as the camera will go in the crouched position, but the controller will not be crouched. It will only start crouching when it collides with a trigger zone telling the controller to start using the engine's crouch command. I think this is the better solution that I can think of. Although, there will need to be some work putting in place of all the zones where the character controller's crouch height is needed (IE: vents, small spaces, etc.)... but that is game development... wink.png

 

Some good comes out of this way because the designer has more control of the player's crouching mobility. Meaning there is less chance that the player can glitch out the controller or map and get into spaces that the designer does not want the player to squeeze into.

  • Upvote 1

Play Our Latest Game: Relic Rogue

Link to comment
Share on other sites

You can raycast from the front and top of the character controller to the ground. And another ray from the bottom faceing front. If while crouched the bottom raycast hits something with an angle greater than 45, and the top ray has a correct step height, move the player up by step height + 1cm. The controller should take care of the rest.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...