diff --git a/levels/blockout_3.tscn b/levels/blockout_3.tscn index 569000a..1f465ca 100644 --- a/levels/blockout_3.tscn +++ b/levels/blockout_3.tscn @@ -380,10 +380,9 @@ script = ExtResource("13_v1s63") shape = SubResource("SphereShape3D_vyys8") [node name="switch3" parent="Door1" groups=["interact", "switch_override"] instance=ExtResource("10_lktr8")] -transform = Transform3D(1.655, 0, 0, 0, 1.655, 0, 0, 0, 1.655, 4.27439, 2.00195, -23.9803) +transform = Transform3D(1.655, 0, 0, 0, 1.655, 0, 0, 0, 1.655, 4.55934, 1.62823, -22.3877) skeleton = NodePath("../..") script = ExtResource("15_0sc55") -toggle_enabled = true [node name="StaticBody3D" type="StaticBody3D" parent="Door1/switch3" groups=["interact", "switch"]] collision_layer = 3 diff --git a/levels/switchcontroller.gd b/levels/switchcontroller.gd index 308e031..85e5b01 100644 --- a/levels/switchcontroller.gd +++ b/levels/switchcontroller.gd @@ -17,6 +17,9 @@ func _ready() -> void: switch_override = i else: switches.append(i) + + print("switches " + str(switches)) + print("override switches " + str(switch_override)) func _on_switch_changed() -> void: @@ -27,17 +30,22 @@ func _on_switch_changed() -> void: switches_on += 1 #First check override switch and open or close door - if switch_override.switched_on: - if door.door_open == false: - door.open() - else: - if door.door_open == true: - door.close() + if switch_override != null: + print("null check passed") + if switch_override.switched_on: + print("switched on") + if door.door_open == false: + door.open() + else: + if door.door_open == true: + door.close() #Otherwise follow standard switches - elif switches_on >= switches_needed: - if door.door_open == false: - door.open() - else: - if door.door_open == true: - door.close() + elif switches_on == switches_needed: + print("switch check run with " + str(switches_on) + "switches on") + if door.door_open == false: + door.open() + else: + print("switch check run with " + str(switches_on) + "switches on") + if door.door_open == true: + door.close()