M
M
Max Bogachov2017-03-11 11:38:18
2D
Max Bogachov, 2017-03-11 11:38:18

Pointing 2D object to Unity cursor?

How to make the object look at the cursor? (The game is designed for a top view, if that)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2017-03-11
@Geekinder

You already know the position of the cursor - Input.mousePosition
Get a point in the "game world" - Camera.ScreenToWorldPoint
And rotate the object - Transform.LookAt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question