[gd_scene format=3 uid="uid://c1b435e74tfx1"] [ext_resource type="PackedScene" uid="uid://d0xcnfxqf4xv" path="res://assets/models/props/fragments/rack_fragments.blend" id="1_jygfe"] [ext_resource type="PackedScene" uid="uid://tdwettjsx1o2" path="res://objects/effects/impact_flash_green_large.tscn" id="2_ey6co"] [ext_resource type="Material" uid="uid://7d4c1oui1np3" path="res://assets/effects/particle_materials/explosion_dithered.tres" id="3_m1bqq"] [ext_resource type="PackedScene" uid="uid://dn1lu8316stf0" path="res://objects/effects/destroyed_object_audio.tscn" id="4_ey6co"] [sub_resource type="GDScript" id="GDScript_jygfe"] resource_name = "RackDestroyed" script/source = "extends Node3D var count : int = 0 func _ready(): $ImpactFlash2.restart() await PlayerCamera.get_instance().impact_effect($ImpactFlash2.process_material.color, 0.1, 0.0, 0.02).timeout iter(self) func iter(node): for child in node.get_children(): if child is RigidBody3D: child.linear_velocity = ((child.global_position - global_position).normalized() + Vector3(1, 0 ,0).rotated(Vector3.UP, randf_range(0, PI*2)).normalized()) * 4 child.angular_velocity = Vector3(randf_range(4, 5), randf_range(4, 5), randf_range(4, 5)) count += 1 if count % 3 != 0: get_tree().create_timer(5 + (count % 5)).timeout.connect(child.queue_free) iter(child) " [sub_resource type="QuadMesh" id="QuadMesh_wl07y"] material = ExtResource("3_m1bqq") center_offset = Vector3(0, 0, -0.1) [sub_resource type="BoxShape3D" id="BoxShape3D_ey6co"] size = Vector3(1.0722656, 0.76708984, 1.2509766) [node name="RackDestroyed" type="Node3D" unique_id=236861400] script = SubResource("GDScript_jygfe") [node name="rack_fragments" parent="." unique_id=1382781049 instance=ExtResource("1_jygfe")] [node name="ImpactFlash2" parent="." unique_id=297038791 instance=ExtResource("2_ey6co")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00251311, 1.4693413, 0) draw_pass_1 = SubResource("QuadMesh_wl07y") [node name="AnimatableBody3D" type="AnimatableBody3D" parent="." unique_id=228382645] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.63204515, 0) collision_layer = 10 collision_mask = 10 [node name="CollisionShape3D" type="CollisionShape3D" parent="AnimatableBody3D" unique_id=825060925] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.23071289, 0) shape = SubResource("BoxShape3D_ey6co") [node name="DestroyedObjectAudio" parent="." unique_id=1054350173 instance=ExtResource("4_ey6co")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.63204515, 0)