-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct process to add a Collider #504
Comments
Adding a physics debug visualization will help you here. Here's how to do that in bevy_xpbd. Your issue seems to be that your commands.entity(tilemap_entity).add_child(tile_entity); to your tile spawning code, or remove the offset from the |
That's immediately so much clearer! Colliders were nowhere near the tiles. Adding the tile as a child of the map works a treat (I wasn't sure how to go about removing the offset). Thanks so much for your help. Would a simple example of tile collision be useful, or is it a bit much given it'd add |
I know @StarArawn has been contemplating removing the |
Exactly right. I might chuck something in a gist and link it from here, should be sufficient documentation. |
This should do the trick: https://github.com/richchurcher/tile_collision_example_xpbd Cheers! |
Hello and thank you for
bevy_ecs_tilemap
! I'm playing with tilemaps andbevy_xpbd
, and I wonder if perhaps this is just inexperience or if I'm encountering a side effect of #500, but I'm having a hard time getting tiles in a tilemap to collide with a player object (just a 2d mesh with a transform, an xpbdRigidBody::Dynamic
and an xpbdCollider
).Given something like this, I notice there are invisible colliders in the middle of the tilemap square, but nothing around its edges:
(adapted from the
basic
example). I'd be happy to contribute an example once I get all this cleared up, but it's entirely possible I've just misunderstood the basics. Any pointers to examples or clarifying where I'm going wrong would be super helpful.(screenshot shows player in green, enemy in red, tile "wall" in orange and obviously not colliding with anything).
The text was updated successfully, but these errors were encountered: