Answer the question
In order to leave comments, you need to log in
How to get mouse coordinates relative to the world?
How to get mouse position on stage, I use:
Vector2 screenPosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
Vector2 worldPosition = Camera.main.ScreenToWorldPoint(screenPosition);
Debug.Log(worldPosition);
Answer the question
In order to leave comments, you need to log in
You write to screenPosition the deviation of the mouse from 0, at the moment. What moves the mouse? If with a cursor, then take its coordinates, if there is no cursor ... I don’t know why this might be needed, you can just put a dummy.
It is quite convenient for the cursor to move the trigger.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question