Y
Y
Yura Berezovsky2018-08-01 21:18:04
Game development
Yura Berezovsky, 2018-08-01 21:18:04

How to fix collider stuck?

Here is such a situation. 5b61f6e7850c5776596263.pngGG collider joins the corner and gets stuck there. How can this be fixed if changing friction to a non-zero value will make the hero very slippery when moving on horizontal surfaces. Removing the capsular collider does not solve the problem either, since the GG, with a frozen rotation along the z axis, sometimes gets stuck on surfaces that are not absolutely horizontal. I thought to make it so that the GG was always perpendicular to the plane on which it stands, but I'm a little afraid to implement such a script through the formulas for the perpendicularity of a vector to a straight line. Is it possible to fix this somehow easily?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yura Berezovsky, 2018-08-02
@Jurajkeee

I fixed the problem like this, added 2 raycasts, if the left one is in the air and the right one is not, then the player is on the corner. If so then I change the friction of the capsular collider to 0 and it slides off.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question