Answer the question
In order to leave comments, you need to log in
How to change the angle of an object to match the surface?
I have an object with a circle collider 2d, and an uneven surface with a polygon collider 2d.
Now the corner is up. And it is necessary that the angle of the object be depending on what angle the given section of the surface has.
Answer the question
In order to leave comments, you need to log in
You need to get the shortest distance from the center of the collider to a point on the surface along the entire path of the curve and immediately create an array of object rotation angles depending on the location relative to the surface path.
PS: It's better not to take the point of contact, because. if the object jumps, falls off the slope - it will sway randomly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question