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
I'm playing with the Tank demo and I would like to encapsulate a collision body within different objects, such as: target and bullet. This way when the bullet collides with a target, I can check what hit target (if the bullet, the tank or other) and react accordingly.
Unfortunately I can't seem to find the correct approach. When I iterate the body.potentials(); I can't backtrack to which object contained it and I can't seem to find a unique id that is assigned to a given body that I could use as reference.
Can you please advise on the correct approach?
The text was updated successfully, but these errors were encountered:
I'm playing with the Tank demo and I would like to encapsulate a collision body within different objects, such as: target and bullet. This way when the bullet collides with a target, I can check what hit target (if the bullet, the tank or other) and react accordingly.
Unfortunately I can't seem to find the correct approach. When I iterate the
body.potentials();
I can't backtrack to which object contained it and I can't seem to find a unique id that is assigned to a given body that I could use as reference.Can you please advise on the correct approach?
The text was updated successfully, but these errors were encountered: