- Home /
How to highlight a box in a grid on mouse hover, action whenever clicked
Alright so I should probably mention I do know what a collision is, but i've never really worked much in unity so i'm just starting out. I've created a static grid in photoshop(i'm going to make this dynamic later), each sqaure in the grid 40x40px.
Essentially I just want it so whenever the mouse hovers over a box that box will glow, and will have a collision but only upon click.
Feel free to show advanced code if necessary, I'll be able to figure all of that out, I used to use XNA and this is a big jump, so I appreciate the help! I've also attached a screenshot of the current environment if that gives you any ideas.
]
Hey bud, sounds like you need to look at the On$$anonymous$$ouse events that are supplied in Unity. here is the link to docs for that subject matter, checking about halfway down to see the On$$anonymous$$ouse Events like On$$anonymous$$ouseOver, Down, Enter, Exit... all of which can be used to effect hover and click actions. With respect to highlighting with your hover or click etc, you might go for a material or color change. For that you should look at.. Color Renderer.$$anonymous$$aterial
hope these help you on your way bud. when you have something coded and you get stuck , bring it back here and we can help with anything you get stuck with. take care bud Gruffy
Your answer
Follow this Question
Related Questions
Block Touch 1 Answer
Unity mouse input gradually becomes off 0 Answers
Do not allow "click" on anithing unless it's in a GUI.Box 0 Answers
Check if an image has been clicked 1 Answer
Disable mouse input and cursor in game 2 Answers