diff --git a/Nodes/Player.tscn b/Nodes/Player.tscn index 5876e14..1bda03c 100644 --- a/Nodes/Player.tscn +++ b/Nodes/Player.tscn @@ -22,6 +22,7 @@ animations = [{ radius = 0.494048 [sub_resource type="CylinderShape3D" id="CylinderShape3D_8lrgm"] +radius = 0.808068 [node name="CharacterBody3D" type="CharacterBody3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0) @@ -39,7 +40,6 @@ transform = Transform3D(1.57581, 0, 0, 0, 2.16936, 0, 0, 0, 1.5749, 0, 0, 0) shape = SubResource("CylinderShape3D_h8ivv") [node name="HitBox" type="Area3D" parent="."] -collision_mask = 4 [node name="CollisionShape3D" type="CollisionShape3D" parent="HitBox"] transform = Transform3D(2.74062, 0, 0, 0, 2.24144, 0, 0, 0, 2.70992, 0, 0, 0) diff --git a/Storage.tscn b/Storage.tscn index 2bcf470..0e08383 100644 --- a/Storage.tscn +++ b/Storage.tscn @@ -5,7 +5,7 @@ [sub_resource type="CylinderShape3D" id="CylinderShape3D_c1ipa"] height = 3.60519 -radius = 2.08877 +radius = 1.33696 [node name="Storage" type="StaticBody3D"] script = ExtResource("1_guwoh") diff --git a/player.tscn b/player.tscn index 826128f..644701d 100644 --- a/player.tscn +++ b/player.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://lvlbpfnwlngv"] +[gd_scene load_steps=8 format=3 uid="uid://lvlbpfnwlngv"] [ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"] [ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="2_71mfj"] [ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="3_in6up"] +[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="4_unqt6"] + +[sub_resource type="CylinderMesh" id="CylinderMesh_2q7m8"] [sub_resource type="BoxMesh" id="BoxMesh_ognqx"] size = Vector3(13, 1, 25) @@ -15,7 +18,12 @@ transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, -12, 0, script = ExtResource("1_0x664") [node name="Cannon" parent="." instance=ExtResource("2_71mfj")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.52346, 1.58651, -1.96232e-14) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.00885, 1.58651, -2.74986) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Cannon"] +transform = Transform3D(1, 0, -3.55271e-15, 0, 1, 0, 3.55271e-15, 0, 1, 0, 0, 0) +mesh = SubResource("CylinderMesh_2q7m8") +skeleton = NodePath("../../CharacterBody3D") [node name="MeshInstance3D2" type="MeshInstance3D" parent="."] mesh = SubResource("BoxMesh_ognqx") @@ -28,4 +36,5 @@ shape = SubResource("ConcavePolygonShape3D_p3d4e") [node name="CharacterBody3D" parent="." instance=ExtResource("3_in6up")] transform = Transform3D(1, 0, -3.55271e-15, 0, 1, 0, 3.55271e-15, 0, 1, 0, 3, 0) -[node name="Cannon2" parent="." instance=ExtResource("2_71mfj")] +[node name="Storage" parent="." instance=ExtResource("4_unqt6")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.3638, 0, 3.41344) diff --git a/project.godot b/project.godot index 127a278..80c0093 100644 --- a/project.godot +++ b/project.godot @@ -29,7 +29,7 @@ _global_script_classes=[{ "language": &"GDScript", "path": "res://scripts/Logic/MapNode.gd" }, { -"base": "Node", +"base": "StaticBody3D", "class": &"Module", "language": &"GDScript", "path": "res://scripts/Modules/Module.gd" diff --git a/scripts/Player.gd b/scripts/Player.gd index dcd9acc..d5743c0 100644 --- a/scripts/Player.gd +++ b/scripts/Player.gd @@ -64,6 +64,7 @@ func check_interaction(): if Input.is_action_just_pressed(action): for body in $HitBox.get_overlapping_bodies(): if body is Module: + #Storage interaction if not inventory && body is Storage: body.interact(self) @@ -73,3 +74,4 @@ func check_interaction(): func fill_inventory(type): self.inventory = 1 self.resource = type + print(self.resource)