add train

This commit is contained in:
2022-12-10 16:41:10 +01:00
4 changed files with 5 additions and 3 deletions

View File

@@ -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)

View File

@@ -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")

View File

@@ -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"

View File

@@ -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)