Player object won't collide with StaticBody
Asked Answered
G

4

0

Hi All,

Probably a really common issue, but I am trying to make a pong clone as my first game and am really struggling with collision:

As you can see I have a StaticBody2D with a child CollisionShape2D thats set to a rectangle shape.

The player node is the same with a child CollisionShape2D:

The movement for the player is as below:

I have no idea why the objects are not colliding but the player object can just pass right through the StaticBody2D node. Any help would be majorly appreciated as all the documentation and advice online says that this should just work...
I following a tutorial with files located here, I cant see any difference between mine and step 3 yet that one works!

Thanks,
Bepsi

Getraer answered 14/11, 2023 at 11:6 Comment(0)
S
0

Worth downloading the code and checking if it works as you expect and then checking your project against the working version. If you still can't see what's different, perhaps upload your project so someone can take a look at it; there's not enough information here to help.

Settlings answered 14/11, 2023 at 11:14 Comment(0)
G
0

Settlings

Thanks for the reply, yep, tried comparing like for like with the sample project and I can't see anything thats different but I must obviously be missing something because that one works and mine doesn't.

Here is the link to my project https://github.com/BepsiGames/Pong

Getraer answered 14/11, 2023 at 11:27 Comment(0)
S
0

Getraer your project works fine for me.

Settlings answered 14/11, 2023 at 15:57 Comment(0)
G
0

Settlings
Then I have truly gone insane, i've bypassed it for now using the example so I just hope it doesn't happen again

Getraer answered 14/11, 2023 at 16:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.