D
D
DstivjTS2017-09-11 17:39:20
Game development
DstivjTS, 2017-09-11 17:39:20

Is it possible to "easily" rotate an object "to face" the direction of its movement?

The object has a front side, how to make it move "face" in the direction of movement when it bounces against the walls.
"easy" - it means that it is not possible to calculate the "target direction vector" or let heaven, etc. body movement (because I did it and I don’t like it), but let’s say the rigidbody already has a ready-made function (it also calculates the rebound), use it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2017-09-11
@DstivjTS

Take Rigidbody.velocity and stuff it into Quaternion.LookRotation , you get the desired rotation that you can apply to your graphics transform.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question