You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says an isTrigger prop can be passed to the body to make it work as a collision detection trigger (similarly to how cannon-es, use-cannon work following this PR.
However, p2-es does not implement an isTrigger prop anywhere in the codebase.
You can instead pass the sensor boolean when instantiating a shape (codebase ref, but the current implementation off use-p2 doesn't allow to pass extra props to shapes.
Solution?
Add ability to pass extra props to shapes when creating a body or implement the isTrigger prop.
You can use it now as expected. Set an isTrigger prop to the body, it will set the sensor prop on each shape of the body. See examples/src/demos/Trigger.tsx
Problem
The documentation says an
isTrigger
prop can be passed to the body to make it work as a collision detection trigger (similarly to howcannon-es
,use-cannon
work following this PR.However,
p2-es
does not implement anisTrigger
prop anywhere in the codebase.You can instead pass the
sensor
boolean when instantiating a shape (codebase ref, but the current implementation offuse-p2
doesn't allow to pass extra props to shapes.Solution?
Add ability to pass extra props to shapes when creating a body or implement the
isTrigger
prop.Also here's the p2.js sensor demo
The text was updated successfully, but these errors were encountered: