Improved WindSFX

feature-rocketlauncher
unfa 2021-12-18 14:16:20 +01:00
parent 9c5a0abbce
commit a0626116f9
6 changed files with 38 additions and 22 deletions

View File

@ -21,6 +21,15 @@ func _ready():
speed_to_cutoff.bake()
func _physics_process(delta):
# make sure the sound is only played if this is the current player
if get_multiplayer_authority() == get_tree().multiplayer.get_unique_id(): # if the player is looking through our eyes
if playing == false:
playing = true
else:
if playing == true:
playing = false
var speed = get_parent().get_parent().motion_velocity.length()
print("speed: ", speed)

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=44 format=3 uid="uid://cwuys43c7ak61"]
[ext_resource type="Script" path="res://Assets/Characters/Player.gd" id="1"]
[ext_resource type="AudioStream" uid="uid://gbs6q7vx33ni" path="res://Assets/SFX/WhiteNoise.ogg" id="2_76pkp"]
[ext_resource type="AudioStream" uid="uid://cy80oknjqs5om" path="res://Assets/SFX/Wind.wav" id="2_4ifi7"]
[ext_resource type="PackedScene" uid="uid://bemrov0tiy08n" path="res://Assets/Weapons/Weapon.tscn" id="3"]
[ext_resource type="Script" path="res://Assets/Audio/WindSFX.gd" id="3_7t4ny"]
[ext_resource type="Texture2D" uid="uid://pnh872qjk0oy" path="res://Assets/Effects/Flame.png" id="3_jw7jd"]
@ -31,11 +31,11 @@ height = 1.7
[sub_resource type="Curve" id="Curve_drgxy"]
min_value = -80.0
max_value = 0.0
_data = [Vector2(0, -80), 0.0, 102.109, 0, 0, Vector2(1, 0), 2.1708, 0.0, 0, 0]
_data = [Vector2(0, -80), 0.0, 316.994, 0, 0, Vector2(0.0535332, -61.8182), 226.424, 188.687, 0, 0, Vector2(1, 0), 2.1708, 0.0, 0, 0]
[sub_resource type="Curve" id="Curve_mmscc"]
max_value = 100.0
_data = [Vector2(0, 28.1818), 0.0, 6.633, 0, 1, Vector2(0.274112, 30), 6.633, 0.0, 1, 0, Vector2(1, 70.9091), 0.0, 0.0, 0, 0]
_data = [Vector2(0, 28.1818), 0.0, 7.9355, 0, 1, Vector2(0.229122, 30), 7.9355, 0.0, 1, 0, Vector2(1, 99.0909), 172.113, 0.0, 0, 0]
[sub_resource type="CapsuleShape3D" id="2"]
radius = 0.4
@ -250,9 +250,7 @@ mesh = SubResource( "1" )
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.45276, 0)
[node name="WindSFX" type="AudioStreamPlayer" parent="Head"]
stream = ExtResource( "2_76pkp" )
volume_db = -50.0
autoplay = true
stream = ExtResource( "2_4ifi7" )
bus = &"WindSFX"
script = ExtResource( "3_7t4ny" )
speed_to_volume = SubResource( "Curve_drgxy" )

Binary file not shown.

View File

@ -1,16 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://gbs6q7vx33ni"
path="res://.godot/imported/WhiteNoise.ogg-6280e93b7b1c9263391e422d5cccc729.oggvorbisstr"
[deps]
source_file="res://Assets/SFX/WhiteNoise.ogg"
dest_files=["res://.godot/imported/WhiteNoise.ogg-6280e93b7b1c9263391e422d5cccc729.oggvorbisstr"]
[params]
loop=true
loop_offset=0

BIN
Game/Assets/SFX/Wind.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,22 @@
[remap]
importer="wav"
type="AudioStreamSample"
uid="uid://cy80oknjqs5om"
path="res://.godot/imported/Wind.wav-5f9a4f6612641f9ac89ee5eaf6b45935.sample"
[deps]
source_file="res://Assets/SFX/Wind.wav"
dest_files=["res://.godot/imported/Wind.wav-5f9a4f6612641f9ac89ee5eaf6b45935.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=true
compress/mode=0