Zooming into the scope

Hello i was just wondering if anybody could tell me this…

i created a sniper i have done the zoom in animation where it goes to your eye but then i dont no how to make it so it blacks out the screen but has the sniper crossair on the hole of the screen… if anybody could help me that would be great

Thanks benjimazza.

you could detect when the animation has finished playing by using:

yield WaitForSeconds(animation[“AnimationName”].length); // use inside your Aim function not Update()

then disable the mesh renderer / or 3d object by using:

gameObject.GetComponent(“MeshRenderer”).enabled = false; // if the script is attached to the 3d mesh

if the 3d mesh is a child object of the script attached gameobject then create a var for the 3d mesh then use:

VarName.GetComponent(“MeshRenderer”).enabled = false;

Then for the sniper scope create a GUI Texture which fills the entire screen and assign it a texture of the blacked out sniper scope, like

then enable it after you have disabled the 3d mesh

GUITextureVar.guiTexture.enabled = true;