How to prevent KinematicBody2D being pushed by RigidBody2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By congbinh75

I’m new to Godot and I have a question.

I’m trying on my project to make a simple PingPong game. I’m using KinematicBody2D to make the paddle and RigidBody2D to make the ball. When I run it, the ball sometimes push the paddle up or down.

I’m searched the problem on google and found some solutions but those are from Godot 2 and I don’t know that there is any change in Godot 3.

Hope you guys can help me.

:bust_in_silhouette: Reply From: JJHaggar


I’m also new at Godot, but I think maybe you would want to use an StaticBody2D for the paddle instead of a KinematicBody2D.

As far a s I know, that way the physics engine won’t move your paddle. You can have a look at the documentation here: Physics introduction — Godot Engine (3.0) documentation in English

I hope it helps :slight_smile: