I need to make a (for lack of a better term) “action reticle”.
Examples:
This kind of thing is used in a lot of PS2 games, where you can “lock on” to an enemy, often a ring with enemy health displayed etc. Or you hop on an elevator and a reticle pops up around the button, showing that you need to hit the action button to activate the elevator.
How is this best done in Unity?
I have a tank (that holds liquids, not bullets) with a control panel. I need to indicate to the player when they get close, that they need to click a button on the control panel.
I’m not asking you to do it for me, just point me in the right direction something like “make a layer, put a plane in that layer, attach a texture to the plane, set the alpha etc.”
For reference, I’m a programmer, a newbie at 3D and not at all a modeler or an artist.
If I try vehiclesexamples.zip it brings up everything with a zip file mentioned in it. If I try vehiclesexamples (minus the .zip part) I get just this post :(. A google search for vehiclesexamples.zip turns up nothin’
var crosshair : GUITexture;
function Update () {
if(crosshair)
{
var hit : RaycastHit;
if(Physics.Raycast(transform.position,transform.forward,hit))
crosshair.transform.position=camera.main.WorldToViewportPoint(hit.point);
else
crosshair.transform.position=camera.main.WorldToViewportPoint(transform.position+transform.forward*1000);
}
}
OK the bottom script does closer to what I want. I can modify / tweak and get to where I want now, I think.
Thanks, again Targos!
Side Note: You folks are awesome, this is an absolutely awesome forum for someone learning a product like Unity and I have been on a few product forums in my life…