- Home /
Projection that follows mouse locations on Grid
I'm not sure this is possible and have been looking into putting projector on my scene but doesn't seem to fit my needs so was wondering if what I want is possible, and if anyone has suggestions how it can be implemented.
I have a terrain which is on a grid system, I used raycasts to find the location of the grid which is setup like an array so I can select grid squares and change their images independently. But what I want to do now, is have it so the grid appropriate grid square is highlighted when the mouse is over it without actually changing the underlying images, is it possible to place projectors at set x,y coords so that color is projected down onto the map or is there another methods someone knows that might suit this idea better?
Any insights in the right direction would be appreciated. Cheers,
Answer by Tomer-Barkan · Oct 10, 2013 at 03:55 PM
You can create a spotlight object aimed straight down, and then with your script move it to be exactly above the area you want to be highlighted.
Some help with using light objects can be found here:
http://docs.unity3d.com/Documentation/Components/class-Light.html
and here:
http://www.youtube.com/watch?v=u5DNkxkXBeI
An alternative could be to create a hollow square mesh object, that will appear when you hover a tile, and surround the tile, hence highlight it. This would basically mean displaying a frame around your highlighted area, which is a common way of highlighting.