Rincew1nd
Rincew1nd

Reputation: 196

2d collisions not working properly

Working on a platformer game.

For example, collision without logic will overlap each other when you give velocity to one of them (I solve it with triggers that prevent movement to side where other collider is near).

Now I face an unsolvable trouble. Sometimes my character gets stuck in walls

enter image description here

or cant fall because unseen collision happens.

enter image description here

1 - box collider

enter image description here

4 - box collider

enter image description here

2,3 - triggers

Searching haven't give me structured and right answer, so please, help me solve it.

P.S. Character controller script - https://github.com/rincew1nd/Sleepy-mole/blob/master/Assets/Scripts/character_controller.cs

P.S.S. When I turn off "fixed angle" on character rigidbody2d, all works fine, but physics change a lot and I wanna rigidbody2d with "fixed angle".

Upvotes: 1

Views: 621

Answers (1)

Rincew1nd
Rincew1nd

Reputation: 196

I have find an temporary solution for this issue, but it like "invent a wheel", so i still need better solution. Turn on/off fixed angle of rigidbody2d if position not changed for a while and character is not grounded. http://pastebin.com/Qsm4HACj

Upvotes: 1

Related Questions