- Home /
Layers of collision, or multiple collisions
I am currently working on a platformer-type game. My game will need to recognize when the player runs into a wall (to initiate a wall-climb). My problem is that the player is usually colliding with the floor before they ever reach the wall. As such, the code used for colliding with the floor is being executed, while the wall collision is completely ignored. My assumption is because the OnCollisionEnter2D is being triggered by the collision with the floor, and can't be reset until the player "exits" the floor collision.
My question is, can I write my code to be able to have multiple layers of collisions running on one object at the same time (ie, the floor and the wall touching the player at the same time)? Should I place more than one box collider on my player, or is this impossible, and I should look at mixing triggers with collisions? Any feedback is much appreciated. Thanks.
Could you share the screenshot to show how the wall and floor are placed..
Also is it necessary for the player to have collision with the floor?? Or at what time, you don't need the floor collision ??
We have the options such as,
"collision of a abject with some objects can be removed"
or "we could off the floor collider when not needed" . And other options will be there.... So pls share the details so that it is easy to help
Answer by davidjohn123 · Aug 30, 2016 at 02:01 PM
Hi, the best thing is to use platform effector. https://www.youtube.com/watch?v=vo411mcOEP0 this is helpful
Your answer
Follow this Question
Related Questions
Bullet hit the collider of a child object 1 Answer
2D platformer- getting errors I don't understand (c#) 1 Answer
Problem with method Collider2D.isTouchingLayers() 4 Answers
Upon shooting, Raycast target moves infinitely 1 Answer
OnCollisionEnter2D is not working when an object tagged "Enemy" is not present. 2 Answers