[gd_scene format=3 uid="uid://duv72bvrnw7gj"] [ext_resource type="PackedScene" uid="uid://d1yigdxn0ei2g" path="res://assets/models/props/cop_bot_spawner.blend" id="1_gwflr"] [ext_resource type="PackedScene" uid="uid://dvb6sye4mtl5b" path="res://objects/enemies/cop_bot.tscn" id="1_t2oip"] [ext_resource type="PackedScene" uid="uid://c5dgt5hbvpixi" path="res://objects/enemies/enemy_spawner_destroyed.tscn" id="3_3vkgi"] [sub_resource type="GDScript" id="GDScript_gwflr"] resource_name = "CopBotSpawner" script/source = "extends Node3D @export var enemy_scene : PackedScene @onready var timer := $Timer as Timer @onready var spawn_origin := $SpawnOrigin as Node3D @onready var anim := $cop_bot_spawner/AnimationPlayer as AnimationPlayer func start_spawning(): timer.timeout.connect(_timeout) timer.start() _timeout() func _timeout(): var inst : Node = enemy_scene.instantiate() var inst3d : Node3D = inst as Node3D if inst3d: inst3d.position = spawn_origin.global_position inst3d.rotation = spawn_origin.global_rotation get_tree().current_scene.add_child(inst) anim.play(\"door_open\") timer.start() " [sub_resource type="BoxShape3D" id="BoxShape3D_t2oip"] size = Vector3(1.9746094, 2.6134033, 1.7166748) [node name="EnemySpawner" type="Node3D" unique_id=945354431] script = SubResource("GDScript_gwflr") enemy_scene = ExtResource("1_t2oip") [node name="cop_bot_spawner" parent="." unique_id=787136593 instance=ExtResource("1_gwflr")] [node name="Timer" type="Timer" parent="." unique_id=1434679827] wait_time = 2.0 [node name="SpawnOrigin" type="Node3D" parent="." unique_id=959110910] transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0.8010241, -2.1844323) [node name="DestructableObject" type="DestructableObject" parent="." unique_id=1719916666 node_paths=PackedStringArray("shake_object")] collision_layer = 2 collision_mask = 0 defense = 2 destroyed_object = ExtResource("3_3vkgi") shake_object = NodePath("../cop_bot_spawner") [node name="CollisionShape3D" type="CollisionShape3D" parent="DestructableObject" unique_id=1652436183] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3153827, -0.85546494) shape = SubResource("BoxShape3D_t2oip") [editable path="cop_bot_spawner"]