-
How would one add physics (cannon) to an |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Some example code would help sort out your issue. If you're using Here is a working example https://codesandbox.io/s/usecannon-physics-basic-example-y2t7tu?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
-
it doesnt really make sense to mix drei/instance and physics. the whole point of drei/instance is that you are able to control the instances position, but when you couple an object with physics then the physics-engine controls position. react-three/cannon can handle instances out of the box without you having to do anything. |
Beta Was this translation helpful? Give feedback.
-
I have a problem with this, it does works as intended using useSphere(), but when using useBox() it only collides with usePlane() object but not useTrimesh() ones. It's weird. |
Beta Was this translation helpful? Give feedback.
Some example code would help sort out your issue.
If you're using
@react-three/cannon
, don't forget to wrap your physics objects in the<Physics>
component.Here is a working example https://codesandbox.io/s/usecannon-physics-basic-example-y2t7tu?file=/src/index.js