player: handle gears on respawn
Use a preloaded scene to give the player the starting gear rather than making a duplicate of the gear on spawn, and strip any gears from the backpack on death. Remove Gear from the editor scene tree and add it on respawn().
This commit is contained in:
parent
d395bb6f26
commit
9b229e5d8f
2 changed files with 16 additions and 7 deletions
|
|
@ -1,9 +1,8 @@
|
|||
[gd_scene load_steps=9 format=4 uid="uid://cfceg80unq0pe"]
|
||||
[gd_scene load_steps=8 format=4 uid="uid://cfceg80unq0pe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://djeyfi7vm2vw0" path="res://player/player.gd" id="1_onrkg"]
|
||||
[ext_resource type="Script" uid="uid://oi6sint7jkc6" path="res://player/camera_gimbal.gd" id="2_onrkg"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfb0gbwm57hm4" path="res://models/player_0.png" id="3_hqtel"]
|
||||
[ext_resource type="PackedScene" uid="uid://c117buhmmkvkt" path="res://gears/ball.tscn" id="3_yw30f"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_onrkg"]
|
||||
size = Vector3(2, 5, 1)
|
||||
|
|
@ -67,8 +66,6 @@ skeleton = NodePath("")
|
|||
[node name="Container" type="Node3D" parent="Pivot"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 2.5, -1.5)
|
||||
|
||||
[node name="Gear" parent="Pivot/Container" instance=ExtResource("3_yw30f")]
|
||||
|
||||
[node name="CameraGimbal" type="Node3D" parent="."]
|
||||
script = ExtResource("2_onrkg")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue