Luanico
Luanico

Reputation: 1

Unity2D - Is there a way to make a 2d player not stick to walls without changing the physics material?

I started a 2d game and my character with a boxcollider gets stuck to walls (created with a tilemap so with a tilemap and composite collider)

I saw solutions to this where you have to put a physics material with no friction on the player, however if i do that it messes up other movements that use friction (such as a slide) Is there a way to fix it without physics material?

Upvotes: 0

Views: 564

Answers (1)

SpikyOwl
SpikyOwl

Reputation: 111

You can put a physics material with low friction on walls instead of on player

or

you can write a script that when player collide with walls, push player away from wall a little bit depending on the normal of hit point.

Upvotes: 1

Related Questions