From e2eea71d1af321909f62cf66930d7fac8a7260b3 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 4 Jan 2020 17:28:45 +0100 Subject: [PATCH] Fix camera path getter. --- game/player/Player.gd | 2 +- game/player/Player.tscn | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/game/player/Player.gd b/game/player/Player.gd index 2ea305e..d166405 100644 --- a/game/player/Player.gd +++ b/game/player/Player.gd @@ -71,7 +71,7 @@ var world : Node2D = null func _ready() -> void: - camera = $Camera as Camera2D + camera = $Body/Camera as Camera2D world = get_node(world_path) as Node2D diff --git a/game/player/Player.tscn b/game/player/Player.tscn index 57093fe..fe77097 100644 --- a/game/player/Player.tscn +++ b/game/player/Player.tscn @@ -10,19 +10,21 @@ radius = 8.0 [node name="Player" type="Entity" groups=[ "players", ]] -body_path = NodePath("KinematicBody2D") -character_skeleton_path = NodePath("KinematicBody2D/Character") +body_path = NodePath("Body") +character_skeleton_path = NodePath("Body/Character") script = ExtResource( 2 ) [node name="GUILayer" parent="." instance=ExtResource( 3 )] -[node name="KinematicBody2D" type="KinematicBody2D" parent="."] +[node name="Body" type="KinematicBody2D" parent="."] -[node name="Character" parent="KinematicBody2D" instance=ExtResource( 1 )] +[node name="Character" parent="Body" instance=ExtResource( 1 )] +front_node_path = NodePath("../../Body/Character/CharacterFrontModel") +side_node_path = NodePath("../../Body/Character/CharacterSideModel") -[node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Body"] shape = SubResource( 1 ) -[node name="Camera" type="Camera2D" parent="KinematicBody2D"] +[node name="Camera" type="Camera2D" parent="Body"] current = true [connection signal="onc_open_loot_winow_request" from="." to="GUILayer" method="_on_Player_onc_open_loot_winow_request"]