Added player spawn VFX

main
unfa 2021-09-25 19:24:29 +02:00
parent 6c52aafff5
commit e1c7be07f9
2 changed files with 66 additions and 1 deletions

View File

@ -104,6 +104,7 @@ var dead = false: # used to workaround Godot crash when destroying player_nodes
self.show()
$Body.disabled = false
$SpawnSFX.play()
$SpawnVFX.emitting = true
#set_physics_process(true)
dead = value
@ -135,6 +136,7 @@ func _ready() -> void:
$Jetpack/JetpackSound.playing = true
$Jetpack/JetpackSound.stream_paused = true
$SpawnVFX.emitting = true
func aim(event) -> void:
var mouse_motion = event as InputEventMouseMotion

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://cwuys43c7ak61"]
[gd_scene load_steps=27 format=3 uid="uid://cwuys43c7ak61"]
[ext_resource type="Script" path="res://Assets/Characters/Player.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://bemrov0tiy08n" path="res://Assets/Weapons/Weapon.tscn" id="3"]
@ -77,6 +77,52 @@ anim_offset_min = -100.0
anim_offset_max = 100.0
collision_friction = 1.0
[sub_resource type="Gradient" id="Gradient_niqb5"]
offsets = PackedFloat32Array(0, 0.0539419, 1)
colors = PackedColorArray(0, 0, 0, 1, 4, 4, 4, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture" id="GradientTexture_h65ov"]
gradient = SubResource( "Gradient_niqb5" )
[sub_resource type="ParticlesMaterial" id="ParticlesMaterial_lo734"]
emission_shape = 1
emission_sphere_radius = 0.5
spread = 180.0
gravity = Vector3(0, 0, 0)
initial_velocity_min = 1.46
initial_velocity_max = 1.46
angular_velocity_min = -19.42
angular_velocity_max = 10.59
radial_accel_min = 8.63
radial_accel_max = 8.63
tangential_accel_min = 9.68
tangential_accel_max = 9.68
damping_min = 0.22
damping_max = 0.31
angle_min = -103.3
angle_max = 97.0
scale_min = 0.1
scale_max = 0.7
color_ramp = SubResource( "GradientTexture_h65ov" )
[sub_resource type="Curve" id="Curve_gq708"]
_data = [Vector2(0, 0), 0.0, 13.2052, 0, 0, Vector2(0.366936, 0.509091), -2.93091, -2.93091, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_uw8c6"]
blend_mode = 1
shading_mode = 0
vertex_color_use_as_albedo = true
albedo_color = Color(0, 0.137255, 1, 1)
disable_receive_shadows = true
use_particle_trails = true
[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_34621"]
material = SubResource( "StandardMaterial3D_uw8c6" )
size = 0.151
sections = 7
section_length = 0.418
curve = SubResource( "Curve_gq708" )
[node name="Player" type="CharacterBody3D"]
disable_mode = 2
collision_layer = 2
@ -194,6 +240,7 @@ unit_db = -24.0
unit_size = 4.0
max_db = -12.0
pitch_scale = 3.0
doppler_tracking = 2
script = null
[node name="SpawnSFX" type="AudioStreamPlayer3D" parent="."]
@ -201,6 +248,22 @@ stream = ExtResource( "5_bmajs" )
autoplay = true
script = null
[node name="SpawnVFX" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.918712, 0)
layers = 4
emitting = false
amount = 128
lifetime = 2.0
one_shot = true
explosiveness = 1.0
local_coords = false
transform_align = 2
trail_enabled = true
trail_length_secs = 0.35
process_material = SubResource( "ParticlesMaterial_lo734" )
draw_pass_1 = SubResource( "RibbonTrailMesh_34621" )
script = null
[node name="JumpSFX" parent="." instance=ExtResource( "5_yiom2" )]
[node name="AudioStreamPlayer3D" parent="JumpSFX" index="0"]