john doe
0
Q:

unity 2d gun pickup

    public gameobject AK47;              void Update()                     {                         if (Input.GetButton("Interact"))                         {                             UseItemRay = new Ray(PlayerCam.transform.position, PlayerCam.transform.forward);                             if (Physics.Raycast(UseItemRay, out Hit, 10))                             {                                 if (Hit.collider.tag == "Pickup")                                 {                                    if hit.collider.name = "AK47"                                       {                                          ak47.setactive(true);                                       }                                       }                             }                         }                 }
0

New to Communities?

Join the community