Answer the question
In order to leave comments, you need to log in
How to drag an object across world space?
https://pastebin.com/Q3Em5rDj
here is the code where there is some kind of error in OnDrag
why the same coordinate is shown in the debug when calling
Answer the question
In order to leave comments, you need to log in
Perhaps the problem is that when converting the mouse position to world coordinates, you do not specify z (becomes 0 by default). Accordingly, due to insufficient accuracy, the position in the log is written the same.
https://docs.unity3d.com/ScriptReference/Camera.Sc...
"The z position is in world units from the camera."
You have:
pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Input.mousePosition is a Vector2.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question