Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

Help with Gui texture/Audio

$
0
0
Hey i have a gun script that works great but i need to transfer it from pc to android. Like instead of me clicking the scene i want it so when you press a gui texture, it fires, like on the pc version. But, i also need a gunshot sound to play when i touch the gui texture, as i shoot the gun. Here is the gun script! var Bullet : Transform; var Spawn : Transform; function Update () { if(Input.GetButtonDown("Fire1")) { Shot(); } } function Shot() { var pel = Instantiate(Bullet, Spawn.position, Spawn.rotation); pel.rigidbody.AddForce(transform.forward * 10000); }

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>