H
H
HEDAX2020-02-02 20:50:08
C++ / C#
HEDAX, 2020-02-02 20:50:08

How to get click coordinates in unity?

I have a player, and he should move in the direction of the place where the mouse was clicked. But the mouse click is not in the same coordinates as the player, because mousePosition returns pixel coordinates, not transform.position. How can I count everything in the same coordinates?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2020-02-02
@GavriKos Куратор тега Unity

Camera.main.ScreenToWorldPoint и прочие подобные методы.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question