From 3ce0fc5311a92f803b7d6c979ced91a9a6c5fbd0 Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Sat, 28 Dec 2024 17:12:23 -0600 Subject: [PATCH] Fixing helm --- assets/core/interactables/ship-helm/ship_helm.gd | 8 ++------ assets/core/ships/ship_script.gd | 2 +- assets/core/ships/shuttle-class/shuttle-class.tscn | 7 ++++++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/assets/core/interactables/ship-helm/ship_helm.gd b/assets/core/interactables/ship-helm/ship_helm.gd index 0f3ba85..6f3cf98 100644 --- a/assets/core/interactables/ship-helm/ship_helm.gd +++ b/assets/core/interactables/ship-helm/ship_helm.gd @@ -1,11 +1,7 @@ class_name ShipHelm extends Interactable -var parent_ship: Ship - -func _ready(): - parent_ship = get_parent().get_parent() #sets the parent ship to the ship that the helm is placed on - +@export var parent_ship: Ship func interact(): if player_reference.is_network_authority: @@ -17,4 +13,4 @@ func interact(): player_reference.set_is_piloting(false) parent_ship.remove_piloting_player() parent_ship._sync_piloting_state() - \ No newline at end of file + diff --git a/assets/core/ships/ship_script.gd b/assets/core/ships/ship_script.gd index d597a96..9468c83 100644 --- a/assets/core/ships/ship_script.gd +++ b/assets/core/ships/ship_script.gd @@ -102,4 +102,4 @@ func set_piloting_player(player: Player): func remove_piloting_player(): piloting_player = null ship_is_piloted = false - print("The ship is no longer piloted.") \ No newline at end of file + print("The ship is no longer piloted.") diff --git a/assets/core/ships/shuttle-class/shuttle-class.tscn b/assets/core/ships/shuttle-class/shuttle-class.tscn index 4312026..9ae64ff 100644 --- a/assets/core/ships/shuttle-class/shuttle-class.tscn +++ b/assets/core/ships/shuttle-class/shuttle-class.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=7 format=3 uid="uid://y0xb2vktsr1k"] +[gd_scene load_steps=8 format=3 uid="uid://y0xb2vktsr1k"] [ext_resource type="Script" path="res://assets/core/ships/ship_script.gd" id="1_ghft7"] [ext_resource type="Texture2D" uid="uid://gymb0tju4y67" path="res://addons/kennysprototypetextures/Dark/texture_black (1).png" id="2_3koq8"] +[ext_resource type="PackedScene" uid="uid://dm31ddavxv5gt" path="res://assets/core/interactables/ship-helm/ship-helm.tscn" id="3_eyiku"] [sub_resource type="BoxShape3D" id="BoxShape3D_6gbwt"] size = Vector3(5, 0.15, 20) @@ -50,3 +51,7 @@ shape = SubResource("BoxShape3D_7o08p") [node name="HelmLocationMarker" type="Marker3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0) + +[node name="ShipHelm" parent="." node_paths=PackedStringArray("parent_ship") instance=ExtResource("3_eyiku")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -7.54699) +parent_ship = NodePath("..")