Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KinematicCharacterController methods (enableAutoStep, maxSlopeClimbAngle, minSlopeClimbAngle) not working in rapier2d-compat #291

Open
hongha1412 opened this issue Sep 7, 2024 · 2 comments

Comments

@hongha1412
Copy link

hongha1412 commented Sep 7, 2024

Hello Rapier team,

I have encountered an issue with the KinematicCharacterController (KCC) while using rapier2d-compat. Specifically, the following methods do not seem to have any effect:

  1. enableAutoStep
  2. maxSlopeClimbAngle
  3. minSlopeClimbAngle

Environment:

  • Rapier version: rapier2d-compat
  • Platform: TypeScript / JavaScript
  • Use case: 2D side-scrolling game (Phaser 3)

Issue details:

  1. enableAutoStep: When called, the character controller doesn't appear to automatically step over small obstacles or stairs as expected. The character gets stuck at small steps instead of stepping over them.
  2. maxSlopeClimbAngle / minSlopeClimbAngle: These methods seem to have no effect on the KCC's ability to climb or descend slopes. I have tried different angle values, but the character's behavior remains unaffected, and it still slides down slopes regardless of the angle settings.

Expected behavior:

  • enableAutoStep should allow the KCC to step over small obstacles automatically.
  • maxSlopeClimbAngle and minSlopeClimbAngle should control the maximum and minimum angles for climbing slopes or slipping down.

Steps to reproduce:

  1. Set up a KinematicCharacterController in rapier2d-compat.
  2. Try to use the above methods on KCC to modify its behavior.
  3. Observe that the methods do not alter the character's ability to step over obstacles or climb slopes.

Notes:

  • I'm developing a 2D side-scrolling MMORPG using Phaser 3 with Rapier for physics.
  • Is this a known issue with rapier2d-compat? Is there any workaround or fix available? Or am i missing something when config rapier world/KCC?
  • For some reason, i have disabled gravity simulate on controller when character standing on obstacles/ground

Thank you for your attention, and I look forward to your response!

@Vrixyz
Copy link
Contributor

Vrixyz commented Sep 8, 2024

Hello, thanks for the report!

The character slide bug originated from rapier and is fixed in dimforge/rapier#701 which should be merged soon ; then it make its way to an update to rapier.js 👍

I didn't investigate the stairs situation but I've seen other users mentioning it, I wouldn't be surprised if it's originating from rapier too. I'll keep you updated when I take a look at it!

@AlaricBaraou
Copy link

Hello, wanted to add that this issue is also observable in rapier3d-compat.
The autoStep and slope parameters don't work as expected.

autoStepKCC.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants