516083025 by Unknown

516083025 by Unknown

Author:Unknown
Language: eng
Format: epub


So, the grenades work quite well; however, it would be great to add a sound effect for the grenade, when they are thrown and when they explode, and we will do that just now:

Please open the script

Add the following lines at the beginning of the script (new code in bold).

extends KinematicBody

export (PackedScene) var grenade

export (AudioStream) var sound_grenade_launch:AudioStream

export (AudioStream) var sound_gun :AudioStream

In the previous code we create two variables sound_grenade_launch and sound_gun that will be accessible through the Inspector.

You can save your script, switch to the 3D workspace, select the node player in the Scene and look at the you should now see two new placeholders, as per the next figure.

Please locate the file grenade_launch.wav in the FileSystem window, and drag and drop it to the empty field to the right of the label Sound do the same for the file gunshot for the field to the right of the label Sound as per the next figure.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.