When the player clicks the fire button, a crosshair image will be instantiated, and when they click again I want the name of the crosshair image to change to boom. However, when the crosshair is instantiated the name is already boom. Any ideas? Thanks
if (Input.GetMouseButtonDown(0))
{
if (hitInfo.transform.gameObject.tag == "fire")
{
if (crosshair == 1)
{
GameObject Aimz = Instantiate(aim, rb2D.transform.position, rb2D.transform.rotation) as GameObject;
Aimz.name = "crosshair";
if (Input.GetMouseButtonDown(0))
{
if (hitInfo.transform.gameObject.tag == "fire")
{
Aimz.name = "boom";
}