Looking at the scene, the reason the box is moving is because it is a child node of the Ball
node, and since the Ball
node is moving, all of its children nodes will move too.
There are a few easy fixes. The easiest fix is to simply make a new scene with the box and set it up as you have it in the ball scene. Then make another new scene and instance both the ball scene and the box scene into that. Then the ball will be able to move without moving the box since the box will not be part of the ball scene.
The other way to fix the problem is instead of directly modifying the position of the Ball
node, instead modify the position of only the nodes responsible for the ball itself. Looking at the pictures posted, it looks like Area2D
will mpve the ball and its sprite, without moving the box. Personally, I would not use this fix and instead use the fix above as it will be easier to manage as your game gets larger, but depending on what the box is supposed to do it may make more sense to have it part of the ball scene.
Regardless, either moving the box out into its own scene or only moving the ball related nodes should fix the problem. Hopefully this helps :smile: