Change object detection to it's own layer so it doesn't crash on non-objects

This commit is contained in:
2023-10-07 18:33:55 -07:00
parent 6d4c977c35
commit 63da273c4c
3 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@ corner_radius_bottom_right = 10
corner_radius_bottom_left = 10 corner_radius_bottom_left = 10
[node name="character" type="CharacterBody2D"] [node name="character" type="CharacterBody2D"]
collision_layer = 3
script = ExtResource("1_qlitf") script = ExtResource("1_qlitf")
[node name="camera" type="Camera2D" parent="."] [node name="camera" type="Camera2D" parent="."]
@ -70,6 +71,7 @@ libraries = {
[node name="raycast" type="RayCast2D" parent="body_pivot"] [node name="raycast" type="RayCast2D" parent="body_pivot"]
target_position = Vector2(0, -100) target_position = Vector2(0, -100)
collision_mask = 2
[node name="body" type="Sprite2D" parent="body_pivot"] [node name="body" type="Sprite2D" parent="body_pivot"]
scale = Vector2(0.2, 0.2) scale = Vector2(0.2, 0.2)

View File

@ -35,6 +35,7 @@ _data = {
} }
[node name="stone" type="StaticBody2D"] [node name="stone" type="StaticBody2D"]
collision_layer = 3
script = SubResource("GDScript_d7f4g") script = SubResource("GDScript_d7f4g")
[node name="collision" type="CollisionShape2D" parent="."] [node name="collision" type="CollisionShape2D" parent="."]

View File

@ -35,6 +35,7 @@ _data = {
} }
[node name="tree" type="StaticBody2D"] [node name="tree" type="StaticBody2D"]
collision_layer = 3
script = SubResource("GDScript_si3d7") script = SubResource("GDScript_si3d7")
[node name="collision" type="CollisionShape2D" parent="."] [node name="collision" type="CollisionShape2D" parent="."]