Closed thusimon closed 2 years ago
You can access e.body
to know the body it collided with.
Tip, if you use cannon-es you can make use of the types as well, since you're using typescript.
Thanks a lot Macro, that example fixed my issue. And it is good to know the cannon-es
repo and all its examples.
Hi, I am working on a FPS game, the arena is formed with a ground and four walls, they are all
STATIC
type. Players and their bullets are allDYNAMIC
type, when I created all the bodies, I can set some custom data to the body, e.g:groundBody.name = 'ground'
And when I get collide event by thisHow can I tell the bullet hit ground, walls or players? Thank you very much!