pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.38k stars 699 forks source link

Bvh raycast: Cannot read properties of undefined (reading 'count') #2092

Open hichemfantar opened 1 month ago

hichemfantar commented 1 month ago

Problem description:

Enabling Bvh on my scene and holding a ref to my ecctrl controlled character causes an error. related to https://github.com/pmndrs/ecctrl/issues/97

Relevant code:

https://github.com/pmndrs/ecctrl/tree/main/example

<Canvas>
  <Bvh firstHitOnly>
    <Scene />
  </Bvh>
</Canvas>

Suggested solution:

i'm thinking maybe it's because drei is using an older version of three-mesh-bvh