StickerClone/core/bridgeNode.tscn
2024-07-30 10:14:56 +02:00

40 lines
1.2 KiB
Text

[gd_scene load_steps=2 format=3 uid="uid://clqvgh6qmglue"]
[sub_resource type="GDScript" id="GDScript_8d33s"]
resource_name = "bridge"
script/source = "extends Area2D
var wallObjects : Array
# 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_body_entered(object):
print(\"Entered %d\",object)
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ):
for _object in wallObjects:
if (_object != null):
_object.process_mode = Node.PROCESS_MODE_DISABLED
else:
wallObjects.append(object)
func _on_body_exited(object):
if (object.has_meta(\"Type\") and object.get_meta(\"Type\") == \"Player\" and wallObjects != null ):
for _object in wallObjects:
if (_object != null):
_object.process_mode = Node.PROCESS_MODE_INHERIT
"
[node name="BridgeNode" type="Area2D"]
script = SubResource("GDScript_8d33s")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]