GodotSourceEngineMovement icon indicating copy to clipboard operation
GodotSourceEngineMovement copied to clipboard

Crouching jumping causing clipping and collision size not reflecting crouch

Open EricXu1728 opened this issue 2 years ago • 1 comments

Hi, I'm not sure if you are still working on this or if this is a problem with only me, so I'm writing this for any other people who pass by who share the same problem.

Crouching while the top is near a ceiling will cause the player to clip through. I fixed this by changing the Crouch() function in human.gd to: func Crouch(): if is_on_floor(): var a = Vector3(0,-200, 0) move_and_slide_with_snap(a, snap, Vector3.UP, true, 4, ply_maxslopeangle, false) else: var b =Vector3(0, 200, 0) move_and_slide_with_snap(b, snap, Vector3.UP, true, 4, ply_maxslopeangle, false)

The number 200 can be adjusted to make crouching look smoother and how high a ledge is jumpable. I am not entirely sure how this works and why the previous function didn't work.

As for the collision not shrinking when crouching, I haven't implemented a good fix yet, sorry.

EricXu1728 avatar Mar 25 '23 22:03 EricXu1728

I may also make a godot 4 version as the version conversion causes issues with class names, inheritance, removing scripts from objects, and input maps.

EricXu1728 avatar Mar 25 '23 22:03 EricXu1728