I've just started playing around with bevy and wanted to add physics to my test project. As I was changing things over I encountered a weird bug, where some physics objects were not being removed properly. I tried changing the hit detection over to the collision event listener, but that had the same issues. After moving the system around a bit the bug went away, but then there was no knock back effect when the projectiles hit the enemy.
projectile_collision_event: check projectile hits with collision events
projectile_collide_check: check projectile hits with transform collide check
When in the Update stage, the physics seem to be mostly ignored. Every now and then they slightly push or rotate the enemy.
When in the PostUpdate stage, they push the enemy away and don't correctly despawn.
While I was creating that test I saw the Collisions component which seems to not have these issues, so I will probably just use that. (projectile_collision_check system)
It would be nice to know why the collision is being registered, without resulting in physics changes. Since it looks like a bug to me, I have opened this issue.
Maybe an example of how something like this is supposed to be implemented would be helpful for newcomers, feel free to use my code as a base for that.
I've just started playing around with bevy and wanted to add physics to my test project. As I was changing things over I encountered a weird bug, where some physics objects were not being removed properly. I tried changing the hit detection over to the collision event listener, but that had the same issues. After moving the system around a bit the bug went away, but then there was no knock back effect when the projectiles hit the enemy.
I have created a short example showcasing the different behaviors here: https://github.com/ottermata/heron-collision-test These systems both suffer from the same issues:
projectile_collision_event
: check projectile hits with collision eventsprojectile_collide_check
: check projectile hits with transform collide checkWhen in the Update stage, the physics seem to be mostly ignored. Every now and then they slightly push or rotate the enemy. When in the PostUpdate stage, they push the enemy away and don't correctly despawn.
While I was creating that test I saw the Collisions component which seems to not have these issues, so I will probably just use that. (
projectile_collision_check
system)It would be nice to know why the collision is being registered, without resulting in physics changes. Since it looks like a bug to me, I have opened this issue.
Maybe an example of how something like this is supposed to be implemented would be helpful for newcomers, feel free to use my code as a base for that.