StickerClone/core/bridgeNode.tscn

41 lines
1.2 KiB
Text
Raw Normal View History

2024-07-24 20:45:32 +00:00
[gd_scene load_steps=2 format=3 uid="uid://clqvgh6qmglue"]
[sub_resource type="GDScript" id="GDScript_8d33s"]
resource_name = "bridge"
script/source = "extends Area2D
2024-07-30 08:14:56 +00:00
var wallObjects : Array
2024-07-24 20:45:32 +00:00
# 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.
2024-07-29 13:24:09 +00:00
func _process(_delta):
2024-07-24 20:45:32 +00:00
pass
func _on_body_entered(object):
print(\"Entered %d\",object)
2024-07-30 08:14:56 +00:00
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
2024-07-24 20:45:32 +00:00
else:
2024-07-30 08:14:56 +00:00
wallObjects.append(object)
2024-07-24 20:45:32 +00:00
func _on_body_exited(object):
2024-07-30 08:14:56 +00:00
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
2024-07-24 20:45:32 +00:00
"
[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"]