TIP: To really see it in action, make one player a CPU player. This is because I have the CPU adding a bit of “spin” to the ball by moving quickly at the last second, just before the ball hits the bat. That allows you to see the problem amplified as the bat is moving so quickly at this point.
It is because you move your bat with the move(<Vector2>) function which moves your body until colliding with something.
You could simple use set_pos(<Vector2>) to prevent this behavior.
Thanks for the answer. I wanted to keep the move() function, so I experimented with the other answer and that worked. Appreciate your response though…
Your moving body needs to be different from the ball hitting body if you want to use move
I put that again here…
Do this:
KinematicBody2D (+script, same mask as wall layer if you use it to limit movement)
|-Sprite
|-CollisionShape2D (if you use it to limit movement)
|-KinematicBody2D (same layer as ball mask)
|-CollisionShape2D
Thank you for your help (again).
That worked perfectly. It took me a bit of experimenting as it’s a bit new to me but I now have one Kinematic controlling the collision with the wall (and handling movement) and another with the ball. No more ball pushing the bat. Great stuff, much appreciated.