- Home /
How do I fix sticking to walls while still allowing friction on the ground?
I know the common response for the sticking-to-walls problem is to add the slippery physics material to my walls. The problem, though, it that I am making a tile-based side-scroller where you can push around boxes. If I make the land tiles slippery, then the boxes slide forever when nudged. I'm hesitant to use multiple colliders per tile, since I'm already having issues with things getting stuck between the tiles (I've minimize the problem by shaving the corners off the colliders, but it still is not the smoothest, so any help with that as well would be appreciated.). Having multiple colliders per tile would probably worsen the collision glitches. Is there any way to have it both ways and not end up with glitchy tile collisions?
Is it possible to use slightly different tiles with different physic materials?
@FabDynamic, no. A single tile must be both ground and walls. Especially since there's an in-game stage editor, and I don't want users confused by the multiple "land" tiles.
Answer by abuelitovip · Nov 18, 2017 at 01:24 AM
Create manual coliders for best control of they material. This example is with 2 colliders "Blue" with 0.3 friction, and orange collider with full friction. Total 3 colliders.
$$anonymous$$anual colliders isn't an option. An in-game editor allows player-generated content, and I don't want players to deal with weird collider fixes themselves.
You can use booleans for the control of states and change the collider or material interaction. In the left boxes use material with 0.8 or 0.9 friction, for don´t stop the player movement.
Your answer
Follow this Question
Related Questions
Softbody physics with 2D sprites 1 Answer
Jumping from special jump orb 1 Answer
2D Jump using "Rigidbody2D.AddForce" doesn't work. 1 Answer
Problem with Falling Platform Script 3 Answers