0 votes

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) :-(

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.

in Engine by (167 points)
edited by

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

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 : https://godotengine.org/qa/11189/collisions-across-canvaslayers

I hope i can achieve a result.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.