-2
\$\begingroup\$

I have a board of tiles in my game in Unity and I have to select a sequence of tiles by moving the pressed mouse over the tiles like if I would select letters in a such game like on the screenshot. Please, hint me, how can I implement this functionality. I'm just a newby in Unity.

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ What is your build target? Mobile, like in the screenshot, or PC/Linux/Mac? \$\endgroup\$
    – Stephan
    Nov 16 '17 at 19:00
  • \$\begingroup\$ Mobile, for Android and iOS. \$\endgroup\$
    – Alexander
    Nov 16 '17 at 19:07
  • \$\begingroup\$ I think using the mouse-enter triggers to queue the object id into an array so you have the order is probably the route you'd want to look into. Do a search for mouse-over events. You should get some good examples. I know for a fact there are several youtube videos about object selection. \$\endgroup\$
    – Stephan
    Nov 16 '17 at 19:28
  • \$\begingroup\$ if you know how to find those videos, please share them with me \$\endgroup\$
    – Alexander
    Nov 16 '17 at 19:35
  • \$\begingroup\$ youtube.com/watch?v=VHeem-mywDk should get you started. Couple with that the check for mouse down and you know the difference between the mouse just passing over, and a selection attempt. \$\endgroup\$
    – Stephan
    Nov 16 '17 at 19:43
0
\$\begingroup\$

A solution for my problem is using this two methods OnMouseEnter() and OnMouseExit.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.