setting parallaxLayer collision

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mokalux
:warning: Old Version Published before Godot 3 was released.

Hello there,

I am trying to set a collision detection on one parallax layer, i hope some nice people could help me.

My setup is the following:
I have a scene. The scene instances a ParallaxBackground and the player (RigidBody2D).

The ParallaxBackground has 3 ParallaxLayers (sky, background, floor).

I have drawn a CollisionPolygon2D (on the layer i would like my player to walk on):
ParallaxLayer (floor)
-sprite
–StaticBody2D
—CollisionPolygon2D

When i run the game the player won’t collide with the layer (floor) :frowning:

How i can do this please or is this possible?

I am not using tiles because the floor is not flat and it is hard to set up tiles so they are not flat.

Thank you in advance.

Usually the part the player interacts with isn’t inside a parallax background, you usually just put “backgrounds” in it. I’m not sure it would work properly otherwise :s

Zylann | 2017-02-03 22:28

thank you Zylann, we can count on you to share your knowledge, i really appreciate your answer. I found another post regarding a similar question and he did it with Physics2DServer : Collisions Across CanvasLayers - Archive - Godot Forum

I hope i can achieve a result.

mokalux | 2017-02-03 23:09