Interactable Chest Collision

This commit is contained in:
Marco 2025-01-29 14:54:01 +01:00
commit 686dea6c8d
8 changed files with 95 additions and 22 deletions

View file

@ -5,6 +5,9 @@
[ext_resource type="Script" path="res://Scripts/Pickupper.cs" id="3_qro6k"]
[ext_resource type="Script" path="res://Scripts/Resources/LootItem.cs" id="4_rcd61"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ihal6"]
radius = 16.0
[sub_resource type="AtlasTexture" id="AtlasTexture_elja3"]
atlas = ExtResource("2_w7a1a")
region = Rect2(0, 0, 16, 16)
@ -70,9 +73,6 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_ihal6"]
radius = 16.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_isrvb"]
size = Vector2(12, 10)
@ -81,19 +81,19 @@ script = ExtResource("4_rcd61")
Item = 3
Amount = 10
[node name="Chest" type="Node2D"]
[node name="Chest" type="Area2D" node_paths=PackedStringArray("Target") groups=["Interactable"]]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_4p5d3")
Target = NodePath("Pickupper")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_ihal6")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_cirgn")
animation = &"Closed"
[node name="Interactable" type="Area2D" parent="." node_paths=PackedStringArray("Target") groups=["Interactable"]]
script = ExtResource("1_4p5d3")
Target = NodePath("../Pickupper")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Interactable"]
shape = SubResource("CircleShape2D_ihal6")
[node name="RigidBody2D" type="RigidBody2D" parent="."]
collision_layer = 64
collision_mask = 10