Testing collisionPolygon2D for Bridge for simplification of programming.
This commit is contained in:
12
Interactables/bridge_area.gd
Normal file
12
Interactables/bridge_area.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends Area2D
|
||||
class_name BridgeArea
|
||||
|
||||
func _on_body_entered(_body: Node2D) -> void:
|
||||
if _body is BaseCharacter:
|
||||
_body.update_collision_layer_mask("in")
|
||||
print("entered!")
|
||||
|
||||
func _on_body_exited(_body: Node2D) -> void:
|
||||
if _body is BaseCharacter:
|
||||
_body.update_collision_layer_mask("out")
|
||||
print("exited!")
|
||||
Reference in New Issue
Block a user