Godot 4
Hi, I’m new to Godot, trying to create pong as a learning experience, and I’m having an issue creating walls.
I’ll put down a static body (or area2d, I tried both) and I will give it a collision shape 2d child node, and yet, my paddle can still move straight off the screen.
And when I move the wall right next to the player and make collision boxes visible, it’s just not there. Any ideas of what I’m doing wrong?
Can you show the scenetree of your staticbody?

This is the Scene tree for the level area. I have a separate scene for the player body scene tree and it’s movement script and such, which I instanced into the level scene. Hence why you can’t see it’s child node, but it has a collision shape 2d just like the wall does, and the player one actually shows up with collision boxes on.
See, even though I moved it down just above the player for testing purposes, it’s just not even there.
Here’s the 2d scene if that helps.
and you set “show collisionsshapes” to true in the debug-tab?
yes, hence why there’s a blue collision square on the paddle
Does your character have gravity?
He might fall downwards making the staticbody disappear
Go to your scenetree while the debug is running.
Change to remote and click through the tree. When you click on the player, the inspector shows the real time variables. Check the position and determine where it is.
1 Like
No, the character does not have gravity, all the script does is let me move it up and down on the screen, which works. And even if the wall had gravity, since I have collision boxes on I would se it falling down
Not sure what half this stuff means, but here it is
Look for “position” when you click on the staticbody2d
not seeing that, are you sure it’s in the remote menu?
Yes. Is there a staticbody2d?
wait, actually there isn’t, I misread and thought I was meant to looking at the character body, but when I go into remote, the staticbody goes away
okay then something frees this object. whats the code thats being executed in this scene?
Any autoloads? and how does your characterscene look like?