Different rigidbody2D not working together?
Hello, I'm trying to make a 2D platformer where my character has different frictions with the floor and the walls. I already used a 2D physics material to give my character a specific friction for the floor. Now I'm trying to do the same thing with this character for the walls, and I tried the next options:
tried to make a Child with another colliders and a rigidbody2D with another 2Dphysics material, but the physics just broke for obvious reasons.
tried to put a rigidbody2D on the wall, but when the character touches the wall, the game only recognizes the rigidBody2D of the character and uses that one.
Changing the character's 2Dphysics material would make the wall-friction work properly, but it would ruin the floor-friction.
Any ideas, techniques or methods? Thank you in advance!
Answer by SpeedPower465 · Apr 04, 2019 at 03:33 AM
I solved it. If anyone has this problem, make sure to put the physic material on the colliders and NOT in the RigidBody
Answer by powernocx · Mar 30, 2019 at 10:17 PM
Hello, to add friction or other 2d phyiscs materials, you need to add 2d colliders (for example: 2d box collider) and then click on the material Button , add a 2d physics . If my answer isn't comlete tell me i'll give you a full guide of how to add 2d physics on a GameObject.
Hello, I already did that. And it works phnomenally when I use a single physic material. But when I create a second 2D box collider with another physic material, the game ignores the new Physic material and uses the first one ins$$anonymous$$d.
Anyway, I solved it. Your logic was the same as $$anonymous$$e, and it was correct. The problem was that I had a Physics material on the RigidBody2D