I am working on creating a vertical scrolling shmup prototype and currently am trying to get collisions working. One problem I have is with the player (characterbody2d) being able to push the enemies (also characterbody2d) on collision. I currently have a knockback effect coded in causing the player to 'bounce' off of the enemy immediately on collision but the enemy is still pushed a little during the initial collision period and if the player is knocked into a second enemy that one is often pushed as well.
I am looking for advice on how to prevent this from happening. Currently when the player collides with the enemy I am turning the enemy's collision layer for the player off for a fraction of a second which has helped, but is not a full solution. My understanding of how the physics process works is also that I cannot disable the physics process for the enemy as well for a moment because the enemy would stop moving and also prevent bullet collision detection.