Bullet hit effects die after 15 seconds

godot4-port
unfa 2020-09-12 22:40:43 +02:00
parent 7aa510b84c
commit 272ef53f4c
2 changed files with 75 additions and 44 deletions

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=25 format=2]
[gd_scene load_steps=26 format=2]
[ext_resource path="res://Assets/Effects/CircleHard.svg" type="Texture" id=1]
[ext_resource path="res://Assets/Effects/CircleSoft.svg" type="Texture" id=2]
[ext_resource path="res://Assets/Effects/FreeTimer.gd" type="Script" id=3]
[sub_resource type="Animation" id=20]
[sub_resource type="Animation" id=1]
resource_name = "Effect"
length = 5.0
step = 0.05
@ -56,33 +57,33 @@ tracks/3/keys = {
"values": [ true ]
}
[sub_resource type="SphereMesh" id=4]
[sub_resource type="SphereMesh" id=2]
radius = 0.1
height = 0.2
radial_segments = 12
rings = 6
[sub_resource type="SpatialMaterial" id=5]
[sub_resource type="SpatialMaterial" id=3]
flags_unshaded = true
albedo_color = Color( 3.72, 2.12, 0.24, 1 )
[sub_resource type="SpatialMaterial" id=21]
[sub_resource type="SpatialMaterial" id=4]
albedo_color = Color( 0.258824, 0.258824, 0.258824, 1 )
[sub_resource type="SphereMesh" id=22]
material = SubResource( 21 )
[sub_resource type="SphereMesh" id=5]
material = SubResource( 4 )
radius = 0.1
height = 0.2
radial_segments = 12
rings = 6
[sub_resource type="Curve" id=19]
[sub_resource type="Curve" id=6]
_data = [ Vector2( 0, 1 ), 0.0, -0.386777, 0, 0, Vector2( 0.987179, 0 ), -0.127956, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=7]
curve = SubResource( 19 )
curve = SubResource( 6 )
[sub_resource type="ParticlesMaterial" id=1]
[sub_resource type="ParticlesMaterial" id=8]
lifetime_randomness = 0.65
spread = 180.0
initial_velocity = 10.0
@ -92,7 +93,7 @@ damping_random = 0.92
scale_random = 0.5
scale_curve = SubResource( 7 )
[sub_resource type="SpatialMaterial" id=2]
[sub_resource type="SpatialMaterial" id=9]
flags_transparent = true
params_billboard_mode = 3
particles_anim_h_frames = 1
@ -101,18 +102,18 @@ particles_anim_loop = false
albedo_color = Color( 0.498039, 0.498039, 0.498039, 1 )
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=3]
material = SubResource( 2 )
[sub_resource type="QuadMesh" id=10]
material = SubResource( 9 )
size = Vector2( 0.1, 0.1 )
[sub_resource type="Gradient" id=8]
[sub_resource type="Gradient" id=11]
offsets = PoolRealArray( 0, 0.0346021, 0.083045, 0.49481, 1 )
colors = PoolColorArray( 1, 0.984375, 0.75, 1, 0.933594, 0.694326, 0.12764, 1, 0.963584, 0.38076, 0.069996, 1, 0.439216, 0, 0, 0.176471, 0, 0, 0, 0 )
[sub_resource type="GradientTexture" id=9]
gradient = SubResource( 8 )
[sub_resource type="GradientTexture" id=12]
gradient = SubResource( 11 )
[sub_resource type="ParticlesMaterial" id=10]
[sub_resource type="ParticlesMaterial" id=13]
lifetime_randomness = 0.34
spread = 180.0
initial_velocity = 10.0
@ -122,11 +123,11 @@ damping_random = 0.92
scale = 0.5
scale_random = 0.5
scale_curve = SubResource( 7 )
color_ramp = SubResource( 9 )
color_ramp = SubResource( 12 )
hue_variation = 0.01
hue_variation_random = 1.0
[sub_resource type="SpatialMaterial" id=11]
[sub_resource type="SpatialMaterial" id=14]
flags_transparent = true
flags_unshaded = true
flags_do_not_receive_shadows = true
@ -140,24 +141,24 @@ particles_anim_loop = false
albedo_color = Color( 4, 4, 4, 1 )
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=12]
material = SubResource( 11 )
[sub_resource type="QuadMesh" id=15]
material = SubResource( 14 )
size = Vector2( 0.1, 0.1 )
[sub_resource type="Gradient" id=13]
[sub_resource type="Gradient" id=16]
offsets = PoolRealArray( 0, 0.0692042, 0.474048, 1 )
colors = PoolColorArray( 0.756863, 0.756863, 0.756863, 0.329412, 0.598546, 0.598546, 0.598546, 0.512111, 0.504174, 0.504174, 0.504174, 0.223016, 0.431373, 0.431373, 0.431373, 0 )
[sub_resource type="GradientTexture" id=14]
gradient = SubResource( 13 )
[sub_resource type="GradientTexture" id=17]
gradient = SubResource( 16 )
[sub_resource type="Curve" id=6]
[sub_resource type="Curve" id=18]
_data = [ Vector2( 0, 0.278253 ), 0.0, 1.12677, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=15]
curve = SubResource( 6 )
[sub_resource type="CurveTexture" id=19]
curve = SubResource( 18 )
[sub_resource type="ParticlesMaterial" id=16]
[sub_resource type="ParticlesMaterial" id=20]
spread = 180.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 5.0
@ -168,12 +169,12 @@ damping = 9.0
damping_random = 0.83
scale = 4.0
scale_random = 0.5
scale_curve = SubResource( 15 )
color_ramp = SubResource( 14 )
scale_curve = SubResource( 19 )
color_ramp = SubResource( 17 )
hue_variation = 0.01
hue_variation_random = 1.0
[sub_resource type="SpatialMaterial" id=17]
[sub_resource type="SpatialMaterial" id=21]
flags_transparent = true
vertex_color_use_as_albedo = true
vertex_color_is_srgb = true
@ -183,23 +184,23 @@ particles_anim_v_frames = 1
particles_anim_loop = false
albedo_texture = ExtResource( 2 )
[sub_resource type="QuadMesh" id=18]
material = SubResource( 17 )
[sub_resource type="QuadMesh" id=22]
material = SubResource( 21 )
[node name="BulletHit" type="Spatial"]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Effect"
anims/Effect = SubResource( 20 )
anims/Effect = SubResource( 1 )
[node name="Hit" type="MeshInstance" parent="."]
transform = Transform( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
mesh = SubResource( 4 )
material/0 = SubResource( 5 )
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 )
mesh = SubResource( 2 )
material/0 = SubResource( 3 )
[node name="Decal" type="MeshInstance" parent="."]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
mesh = SubResource( 22 )
mesh = SubResource( 5 )
material/0 = null
[node name="ParticlesDust" type="Particles" parent="."]
@ -208,8 +209,8 @@ amount = 128
lifetime = 2.0
one_shot = true
explosiveness = 1.0
process_material = SubResource( 1 )
draw_pass_1 = SubResource( 3 )
process_material = SubResource( 8 )
draw_pass_1 = SubResource( 10 )
[node name="ParticlesSparks" type="Particles" parent="."]
emitting = false
@ -217,13 +218,23 @@ amount = 32
lifetime = 2.0
one_shot = true
explosiveness = 1.0
process_material = SubResource( 10 )
draw_pass_1 = SubResource( 12 )
process_material = SubResource( 13 )
draw_pass_1 = SubResource( 15 )
[node name="ParticlesSmoke" type="Particles" parent="."]
emitting = false
lifetime = 4.0
one_shot = true
explosiveness = 1.0
process_material = SubResource( 16 )
draw_pass_1 = SubResource( 18 )
process_material = SubResource( 20 )
draw_pass_1 = SubResource( 22 )
[node name="FreeTimer" type="Timer" parent="."]
wait_time = 15.0
one_shot = true
autostart = true
script = ExtResource( 3 )
__meta__ = {
"_editor_description_": "Time to delete this scene."
}
[connection signal="timeout" from="FreeTimer" to="FreeTimer" method="_on_FreeTimer_timeout"]

View File

@ -0,0 +1,20 @@
extends Timer
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_FreeTimer_timeout():
$"..".queue_free()