Disable Collision for Player #2728
Answered
by
eonarheim
cemalgnlts
asked this question in
Q&A
-
Hi, I have a bomb object in the game. When the player drops the bomb, he cannot interact with it, but enemies can push (throw) the bomb. So, bomb's physics (body) features must be disabled for the player. Can i do this? |
Beta Was this translation helpful? Give feedback.
Answered by
eonarheim
Aug 3, 2023
Replies: 1 comment 2 replies
-
I discovered CollisionGroups but I'm not sure how to add the floor to a group since I'm using tiledMap. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @cemalgnlts! Great question!
I'd definitely use a collision group to make this happen. If the player and the bomb are in the same collision group they won't interact.
There is some additional documentation on collision groups here: https://excaliburjs.com/docs/api/edge/classes/CollisionGroup.html
You can add a collision group to a tile map by retrieving it's body component and setting the group property. Apologies TileMap's don't have the same convenient way as Actors t…