Godot Version
4.3
Question
Why does my StaticBody2D Obstacle get moved by the RigidBody2D Ball?
Here is a link to a video: https://youtu.be/kJiFRLzc8n8
Here is a link to the source code: https://github.com/SpoopCats/KineticPrototype/tree/forum-help
I know it is something to do with my limited knowledge of move_and_collide. I just don’t understand why it would move the obstacle downward, since it’s a StaticBody2D that is supposed to not be acted upon by other bodies.
I am using move_and_collide to detect when the StaticBody2D obstacle hits the edges of the game Window (also StaticBody2D walls) and knows to move left or right in the opposite direction. When I used the position.x property of the obstacle to move it, this did not happen.
I’ve tried putting the code in _process and _physics_process, but in _process it’s even worse and just shoves the obstacle down to the bottom.
My end goal is to have the obstacle move left and right, change direction when it hits the wall, and NOT turn left or right when the RigidBody2D Ball collides with it (I am having issues understanding how to capture collision data and prevent the Ball from being considered a cue to turn left or right as well).