- Home /
Changing scale of unit
I have a 2D tile game project in Unity where every tile has a size of (for example) 50 x 50 pixel and in the grid the tiles are mapped to full integer coordinate, so for example tile0 is at x0 y0, tile1 is at x1 y0, and so on there is always an empty tile which replace with the other tiles. In any case, the player should be able to drag and replace tiles left/right/up/down with the mouse and I want the tile to be dragged along with the mouse position. But when I want to reduce the tiles scale like a 30x30 drag and drop based on mouse position not work accurate. I don't know how to translate the global mouse coordinate into the local space of the dragged tile, and in particular change unit of mouseposition to .9* unit of mouse position
Your answer
Follow this Question
Related Questions
How to have an object some distance above another object Locally? 1 Answer
GameObject.transform.Find().position returning local position for instantiated gameobjects. 0 Answers
Use input.mouseposition to rotate camera 1 Answer
How do i move an object relative to another objects axis. 2 Answers
How does GetRelativeVector work? 1 Answer