Can't make WorldBoundaryShape2D work!

Godot Version

Question

Hi guys!
I couldn’t find any answers on good old google so I come here for some help!
I’m working on an endless sidescroller of sorts and I’m struggling with the world boundaries.

First question : i’d like to know if I’ve understood the documentation well :

I’ve got my player which is a Characterbody2D. It moves at a certain speed automatically to the right of the screen but can “jump” to the right, the left, up or down to avoid some obstacles . The camera follows of course.
I’ve tried to setup some boundaries on the left and right of the screen using Area2Ds with Worldboundary2Ds collisionShape which moves at the same speed as player.

Here is the screenshot of the situation I’m trying to describe :

I’ve changed the normal of the WorldBoundary2D as the screenshot shows.
I’ve setup the collision layers and masks too.

From my understanding, my CharacterBody2D shouldn’t be able to go through the WorldBoundary2D on the left. Is this correct?
THe CharacterBody2D does go through and the collision is registered correctly because I printed some message to check that.

I don’t know what part of code I should show you guys to point me in the right direction…

Thanks for your help!

Hey all and maybe the newbies like me from the future : to make them work as intended, it has to be a child to StaticBody. I didn’t know!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.