- Home /
How to make a PlatformEffector2D doesn't affect a specific layer?
Hi all
I'm trying to make this 2D puzzle platformer game where the player gotta push a wooden box around to solve the puzzle.
Now the problem is that when the wooden box falls to the player, it lands on the player's head, so i assign a PlatformEffector to it so it lands on the ground where the player stands and overlap with the player's head, but now i have a new problem; the wooden box wouldn't land on the ground because the PlatformEffector, so it will just fall pass through the ground. Is there is a way to make the PlatformEffector affects the player but not the ground?
Thanks.
Answer by blend_smile · Jan 03 at 02:13 PM
hi all, its me, again
don't wanna be a jerk by just leaving this without giving any answer so.. Thankfully, someone from another site helped me. Im able to solve this by doing some hackery tricks, i made the wooden box layer doesn't collide with the character layer (by going to Edit > Project Settings > Layer Collision Matrix. For more info, look at the manual). Then i add a new empty game object and make it the child of the wooden box, add edge collider to the empty and PlatformEffector2D (i also deleted the PlatfromEffector2d from the wooden box). Hope this can help someone.
Your answer
Follow this Question
Related Questions
OnCollisionStay2D is ignoring OnCollisionEnter2D 2 Answers
Detecting collision of two game objects? 0 Answers
How to set collision for an object with specific collider size? 3 Answers
draw canvas/2D space Box Colliders on top of 3D objects that are located in world space? 0 Answers
Is it possible to detect collisions between 2d and 3d objects? 2 Answers