ErdongChen-Andrew / CharacterControl

Floating Capsule Character Controller (Rigibody control)
https://character-control.vercel.app
MIT License
378 stars 52 forks source link

Lot's of errors when adding a CuboidCollider to the scene #7

Closed Seanmclem closed 9 months ago

Seanmclem commented 10 months ago

I get Lot's of errors when adding a CuboidCollider to the scene. Just from adding it

like

Uncaught TypeError: Cannot read properties of undefined (reading 'x')
    at Object.current (CharacterController.jsx:667:27)

And

Uncaught TypeError: Cannot read properties of null (reading 'bodyType')
    at Object.current (CharacterController.jsx:609:59)

Edit: Code sandbox in later comment below

ErdongChen-Andrew commented 10 months ago

Hello @Seanmclem , I'm unable to access the sandbox as I'm not a member of the team. Could you please provide more details about the issue? Where were you trying to add the CuboidCollider?

Seanmclem commented 10 months ago

Hello @Seanmclem , I'm unable to access the sandbox as I'm not a member of the team. Could you please provide more details about the issue? Where were you trying to add the CuboidCollider?

Maybe this link will work? Seems to.

Basically just dropped one in the Experience component. Just to start testing around with it, but immediately getting repeated errors and scene never fully loads

just literally adding

         <CuboidCollider
          args={[15, 10, 15]}
          sensor
          onIntersectionEnter={() => console.log("Goal!")}
        />

Edit: added link

ErdongChen-Andrew commented 10 months ago

I see! Currently, the controller does not support the sensor body type. When the character and camera are inside a collider, it triggers an error in every frame. I'll address this issue in the next update. Thanks for bringing this up! 👍

ErdongChen-Andrew commented 10 months ago

Hello @Seanmclem , I believe the bug has been fixed. Let me know if you encounter any further issues.

Seanmclem commented 10 months ago

@ErdongChen-Andrew thanks I'll check it out and close the issue