0

Help me with my pick up gun scipt guys...

Help me wuth my script i will post it below guys (2 posts)

22nd Sep 2017, 6:59 AM
Krieg7
Krieg7 - avatar
4 Réponses
+ 3
What's the issue?
22nd Sep 2017, 5:49 PM
Rrestoring faith
Rrestoring faith - avatar
0
var TheDistance : float = PlayerCasting.DistanceFromTarget; var TextDisplay : GameObject; var FakeGun : GameObject; var RealGun : GameObject; var AmmoDisplay : GameObject; var PickUpAudio : AudioSource; function Update () { TheDistance = PlayerCasting.DistanceFromTarget; if (Input.GetButtonDown("Action")) { if (TheDistance <= 2 ) { TakeNineMil(); } } } function OnMouseOver () { if (TheDistance <= 2 ) { TextDisplay.GetComponent.<Text>().text = "Take 9mm Pistol"; } } function OnMouseExit () { TextDisplay.GetComponent.<Text>().text = ""; } function TakeNineMil () { PickUpAudio.Play(); transform.position = Vector3(0, -1000, 0); FakeGun.SetActive(false); RealGun.SetActive(true); AmmoDisplay.SetActive(true); }
22nd Sep 2017, 7:00 AM
Krieg7
Krieg7 - avatar
0
...
22nd Sep 2017, 10:45 AM
Krieg7
Krieg7 - avatar
0
wait never mind sory for disturbing i figured it out by myself. it was just a prkblem with the distance.
22nd Sep 2017, 10:22 PM
Krieg7
Krieg7 - avatar