2D Toolkit Forum
2D Toolkit => Support => Topic started by: hyundev123 on March 14, 2015, 04:55:44 am
-
Hi,
This is my scenario to implement:
1. There is tilemap :)
2. User click and drag on the tilemap
3. Then, move camera based on that. (Basically, scrolling effect)
I think I got how to handle camera movement based on the clicked and dragged position, but don't know how to detect tilemap easily.
Is there a quick way to detect?
* Sorry, I am new on Unity.
Thank you!
-
You can work out if you've clicked on the tilemap by using tilemap.GetTileAtPosition
It returns true if your world position is in the bounds.
-
Ah right! That is simple/clear way. Thank you! :)