Inventory, Weapons and refactoring

This commit is contained in:
anyreso 2024-05-07 14:21:10 +00:00
parent f43056d251
commit 6df677eda7
70 changed files with 1812 additions and 3895 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@
[gd_scene load_steps=23 format=3 uid="uid://cry3qxi8dxwae"]
[ext_resource type="Texture2D" uid="uid://ct1v5iadtpadm" path="res://entities/player/assets/jetpackfx/smoke_01.png" id="1_ycxvc"]
[ext_resource type="Texture2D" uid="uid://doxo4vfn0bjlp" path="res://entities/player/assets/jetpackfx/smoke_02.png" id="2_ssb7j"]
[ext_resource type="Texture2D" uid="uid://dmf12llra7aq5" path="res://entities/player/assets/jetpackfx/Particle01.png" id="3_1luuf"]
[sub_resource type="Gradient" id="Gradient_3u0pn"]
offsets = PackedFloat32Array(0, 0.872727)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_wjoiw"]
gradient = SubResource("Gradient_3u0pn")
[sub_resource type="Curve" id="Curve_pmb0n"]
max_value = 2.0
_data = [Vector2(0, 0.197802), 0.0, 0.0, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_cj8ky"]
curve = SubResource("Curve_pmb0n")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_v556h"]
emission_shape = 1
emission_sphere_radius = 0.1
angle_min = -381.7
angle_max = 381.7
gravity = Vector3(0, -5, 0)
tangential_accel_min = -5.0
tangential_accel_max = 5.0
scale_curve = SubResource("CurveTexture_cj8ky")
color_ramp = SubResource("GradientTexture1D_wjoiw")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_27esd"]
transparency = 1
cull_mode = 2
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("1_ycxvc")
billboard_mode = 1
billboard_keep_scale = true
[sub_resource type="QuadMesh" id="QuadMesh_hegkl"]
material = SubResource("StandardMaterial3D_27esd")
[sub_resource type="Gradient" id="Gradient_f4nyt"]
offsets = PackedFloat32Array(0, 0.972727)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_ovx5q"]
gradient = SubResource("Gradient_f4nyt")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_l8e6j"]
emission_shape = 1
emission_sphere_radius = 0.1
angle_min = -381.7
angle_max = 381.7
gravity = Vector3(0, -5, 0)
tangential_accel_min = -5.0
tangential_accel_max = 5.0
scale_curve = SubResource("CurveTexture_cj8ky")
color_ramp = SubResource("GradientTexture1D_ovx5q")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bknuu"]
transparency = 1
cull_mode = 2
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("2_ssb7j")
billboard_mode = 1
billboard_keep_scale = true
grow_amount = 1.506
[sub_resource type="QuadMesh" id="QuadMesh_aeure"]
material = SubResource("StandardMaterial3D_bknuu")
[sub_resource type="Gradient" id="Gradient_t1nsw"]
offsets = PackedFloat32Array(0, 0.627273, 0.927273)
colors = PackedColorArray(1, 0.858824, 0.0784314, 1, 1, 0, 0, 1, 1, 0, 0, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_x0y0j"]
gradient = SubResource("Gradient_t1nsw")
[sub_resource type="Curve" id="Curve_fkrx7"]
max_value = 2.0
_data = [Vector2(0, 0.197802), 0.0, 0.0, 0, 0, Vector2(0.594203, 0.395604), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_frkde"]
curve = SubResource("Curve_fkrx7")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_q1vdw"]
emission_shape = 1
emission_sphere_radius = 0.05
angle_min = -381.7
angle_max = 381.7
direction = Vector3(0, -1, 0)
spread = 25.0
initial_velocity_min = 0.5
initial_velocity_max = 1.5
gravity = Vector3(0, -5, 0)
tangential_accel_min = -5.0
tangential_accel_max = 5.0
scale_min = 0.5
scale_max = 0.75
scale_curve = SubResource("CurveTexture_frkde")
color_ramp = SubResource("GradientTexture1D_x0y0j")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2jwv2"]
render_priority = -1
transparency = 1
cull_mode = 2
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("3_1luuf")
emission_enabled = true
emission = Color(1, 0.823529, 0.701961, 1)
billboard_mode = 3
billboard_keep_scale = true
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
[sub_resource type="QuadMesh" id="QuadMesh_uc7ts"]
material = SubResource("StandardMaterial3D_2jwv2")
[node name="JetpackFX" type="Node3D"]
[node name="Smoke1" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.150648, 0)
emitting = false
lifetime = 0.5
one_shot = true
process_material = SubResource("ParticleProcessMaterial_v556h")
draw_pass_1 = SubResource("QuadMesh_hegkl")
[node name="Smoke2" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.108846, 0)
emitting = false
lifetime = 0.5
one_shot = true
process_material = SubResource("ParticleProcessMaterial_l8e6j")
draw_pass_1 = SubResource("QuadMesh_aeure")
[node name="Fire1" type="GPUParticles3D" parent="."]
emitting = false
amount = 16
lifetime = 0.3
one_shot = true
speed_scale = 2.0
process_material = SubResource("ParticleProcessMaterial_q1vdw")
draw_pass_1 = SubResource("QuadMesh_uc7ts")

View file

@ -17,6 +17,14 @@ class_name Player extends RigidBody3D
enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
@export var iff : Control
@export var health_component : HealthComponent
@export var walkable_surface_sensor : ShapeCast3D
## The inventory component can store up to [member Inventory.slots] objects. It
## also has specific slots to hold grenades, packs and a flag.
@export var inventory : Inventory
@export var tp_mesh : Vanguard
@export_category("Parameters")
@export var ground_speed : float = 48 / 3.6 # m/s
@ -37,28 +45,23 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
@export var player_state : PlayerState = PlayerState.PLAYER_ALIVE
@onready var input : PlayerInput = $PlayerInput
@onready var camera : Camera3D = $Smoothing/SpringArm3D/Camera3D
@onready var camera : Camera3D = %Pivot/Camera3D
@onready var hud : CanvasLayer = $HUD
@onready var walkable_surface_sensor : ShapeCast3D = $WalkableSurfaceSensor
@onready var weapon : Node3D = $Smoothing/SpringArm3D/Inventory/SpaceGun
@onready var animation_player : AnimationPlayer = $AnimationPlayer
@onready var health_component : Area3D = $HealthComponent
@onready var collision_shape : CollisionShape3D = $CollisionShape3D
@onready var flag_carry_component : FlagCarryComponent = $Smoothing/SpringArm3D/FlagCarryComponent
@onready var spring_arm_height : float = $Smoothing/SpringArm3D.position.y
@onready var _original_weapon_transform : Transform3D = weapon.transform
@onready var tp_player : Vanguard = $Smoothing/ThirdPerson/PlayerMesh
@onready var jetpack_particles : Array = $Smoothing/ThirdPerson/PlayerMesh/JetpackFX.get_children()
@onready var flag_carry_component : FlagCarryComponent = %Pivot/FlagCarryComponent
@onready var jetpack_particles : Array = $Smoothing/ThirdPerson/Mesh/JetpackFX.get_children()
@onready var match_participant_component : MatchParticipantComponent = $MatchParticipantComponent
signal died(player : Player, killer_id : int)
signal energy_changed(energy : float)
static var pawn_player : Player
var g : float = ProjectSettings.get_setting("physics/3d/default_gravity") # in m/s²
var gravity : Vector3 = g * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
var _jumping : bool = false
static var pawn_player : Player
func _ready() -> void:
match_participant_component.player_id_changed.connect(_setup_pawn)
match_participant_component.player_id_changed.connect(input.update_multiplayer_authority)
@ -67,43 +70,57 @@ func _ready() -> void:
health_component.health_changed.connect(iff._on_health_changed)
health_component.health_changed.emit(health_component.health)
health_component.health_zeroed.connect(die)
inventory.selection_changed.connect(_on_inventory_selection_changed)
energy_changed.connect(hud._on_energy_changed)
input.fired_primary.connect(_fire_primary)
input.fired_primary.connect(_trigger)
input.jumped.connect(_jump)
input.throwed_flag.connect(_throw_flag)
input.MOUSE_SENSITIVITY = Settings.get_value("controls", "mouse_sensitivity")
input.inverted_y_axis = Settings.get_value("controls", "inverted_y_axis")
func _process(_delta : float) -> void:
if _is_player_dead():
iff.hide()
return
else:
iff.show()
%Pivot.global_transform.basis = Basis.from_euler(Vector3(input.camera_rotation.y, input.camera_rotation.x, 0.0))
if not _is_pawn():
tp_mesh.global_transform.basis = Basis.from_euler(Vector3(.0, input.camera_rotation.x + PI, 0.0))
func _physics_process(delta : float) -> void:
_update_jetpack_energy(delta)
func _setup_pawn(_new_player_id : int) -> void:
if _is_pawn():
camera.current = true
camera.fov = Settings.get_value("video", "fov")
pawn_player = self
# set the spring arm translation to be about head height level
$Smoothing/SpringArm3D.transform = Transform3D().translated(Vector3(0, collision_shape.shape.height / 2, 0) * 0.9)
else:
# set the iff attachment translation to be about head height level
$Smoothing/ThirdPerson/IFFAttachment.transform = Transform3D().translated(Vector3(0, collision_shape.shape.height / 2, 0) * 0.9)
$Smoothing/ThirdPerson.show()
%Inventory.hide()
hud.hide()
weapon.hide()
func _is_pawn() -> bool:
var game : Node3D = get_node("/root/Game")
var peer_is_pawn = multiplayer.get_unique_id() == match_participant_component.player_id
return game.mode is Singleplayer or peer_is_pawn
var peer_is_pawn : bool = multiplayer.get_unique_id() == match_participant_component.player_id
return GameManager.mode is Singleplayer or peer_is_pawn
func _fire_primary() -> void:
if _is_player_dead():
return
if not weapon.can_fire():
return
var current_weapon_transform : Transform3D = weapon.transform
weapon.transform = _original_weapon_transform
weapon.fire_primary()
weapon.transform = current_weapon_transform
# @NOTE: this method works only because `tp_mesh` duplicates weapons meshes from the inventory
func _on_inventory_selection_changed(_selected : Node3D, index : int) -> void:
# hide any visible weapon
for child in tp_mesh.hand_attachment.get_children():
child.hide()
# get corresponding selected weapon mesh for third person
var tp_weapon : Node3D = tp_mesh.hand_attachment.get_child(index)
if tp_weapon:
tp_weapon.show()
func _trigger() -> void:
if not _is_player_dead() and inventory.selected:
if inventory.selected.has_method("trigger"):
inventory.selected.trigger()
else:
push_warning("cannot trigger weapon")
func _jump() -> void:
if _is_player_dead():
@ -124,38 +141,21 @@ func _handle_aerial_control(direction : Vector3) -> void:
apply_force(direction * aerial_control_force)
func _handle_jetpack(direction : Vector3) -> void:
if input.jetting:
if energy > 0:
var up_vector : Vector3 = Vector3.UP * jetpack_vertical_force * jetpack_force_factor
var side_vector : Vector3 = direction * jetpack_horizontal_force * jetpack_force_factor
apply_force(up_vector + side_vector)
display_jetpack_particles()
if input.jetting and energy > 0:
var up_vector : Vector3 = Vector3.UP * jetpack_vertical_force * jetpack_force_factor
var side_vector : Vector3 = direction * jetpack_horizontal_force * jetpack_force_factor
apply_force(up_vector + side_vector)
display_jetpack_particles()
func _update_jetpack_energy(delta : float) -> void:
if input.jetting:
if energy > 0:
energy -= energy_drain_rate * delta
if input.jetting and energy > 0:
energy -= energy_drain_rate * delta
else:
energy += energy_charge_rate * delta
energy = clamp(energy, 0, energy_max)
energy_changed.emit(energy)
func _process(_delta : float) -> void:
if _is_player_dead():
iff.hide()
return
else:
iff.show()
if not _is_pawn():
tp_player.global_transform.basis = Basis.from_euler(Vector3(0.0, input.camera_rotation.x + PI, 0.0))
elif not %Inventory/SpaceGun/Mesh/AnimationPlayer.is_playing():
%Inventory/SpaceGun/Mesh/AnimationPlayer.play("idle")
%SpringArm3D.global_transform.basis = Basis.from_euler(Vector3(input.camera_rotation.y, input.camera_rotation.x, 0.0))
func _physics_process(delta : float) -> void:
_update_jetpack_energy(delta)
func _handle_movement() -> void:
# retrieve user's direction vector
var _input_dir : Vector2 = input.direction
@ -168,7 +168,7 @@ func _handle_movement() -> void:
return
# adjust direction based on spring arm rotation
_direction = _direction.rotated(Vector3.UP, $Smoothing/SpringArm3D.rotation.y)
_direction = _direction.rotated(Vector3.UP, %Pivot.rotation.y)
_handle_aerial_control(_direction)
_handle_jetpack(_direction)
@ -206,16 +206,16 @@ func _update_third_person_animations() -> void:
return
if _is_player_dead():
tp_player.set_ground_state(Vanguard.GroundState.GROUND_STATE_DEAD)
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_DEAD)
return
if is_on_floor():
tp_player.set_ground_state(Vanguard.GroundState.GROUND_STATE_GROUNDED)
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_GROUNDED)
else:
tp_player.set_ground_state(Vanguard.GroundState.GROUND_STATE_MID_AIR)
var local_velocity : Vector3 = (tp_player.global_basis.inverse() * linear_velocity)
tp_mesh.set_ground_state(Vanguard.GroundState.GROUND_STATE_MID_AIR)
var local_velocity : Vector3 = (tp_mesh.global_basis.inverse() * linear_velocity)
const bias : float = 1.2 # Basically match feet speed with ground speed
tp_player.set_locomotion(Vector2(local_velocity.x, local_velocity.z), bias)
tp_mesh.set_locomotion(Vector2(local_velocity.x, local_velocity.z), bias)
func _is_player_dead() -> bool:
return player_state != PlayerState.PLAYER_ALIVE

View file

@ -1,20 +1,23 @@
[gd_scene load_steps=41 format=3 uid="uid://cbhx1xme0sb7k"]
[gd_scene load_steps=45 format=3 uid="uid://cbhx1xme0sb7k"]
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_mk68k"]
[ext_resource type="PackedScene" uid="uid://drbefw6akui2v" path="res://entities/player/assets/vanguard.tscn" id="2_beyex"]
[ext_resource type="Shape3D" uid="uid://cb8esdlnottdn" path="res://entities/player/collision_shape.tres" id="2_vjqny"]
[ext_resource type="PackedScene" uid="uid://bcv81ku26xo" path="res://interfaces/hud/hud.tscn" id="3_ccety"]
[ext_resource type="PackedScene" uid="uid://c8co0qa2omjmh" path="res://entities/weapons/space_gun/space_gun.tscn" id="4_6jh57"]
[ext_resource type="Script" path="res://entities/components/match_participant_component.gd" id="6_lrose"]
[ext_resource type="Script" path="res://entities/player/player_input.gd" id="6_ymcrr"]
[ext_resource type="PackedScene" uid="uid://dsysi2rd3bu76" path="res://interfaces/hud/iffs/iff.tscn" id="7_8hc80"]
[ext_resource type="Script" path="res://entities/components/inventory.gd" id="8_768qh"]
[ext_resource type="PackedScene" uid="uid://drbefw6akui2v" path="res://entities/player/vanguard.tscn" id="8_eiy7q"]
[ext_resource type="Script" path="res://entities/components/flag_carry_component.gd" id="8_pdfbn"]
[ext_resource type="PackedScene" uid="uid://d3l7fvbdg6m5g" path="res://entities/flag/assets/flag.glb" id="9_fce2y"]
[ext_resource type="Texture2D" uid="uid://ct1v5iadtpadm" path="res://entities/player/assets/jetpackfx/smoke_01.png" id="9_4pant"]
[ext_resource type="PackedScene" uid="uid://c8co0qa2omjmh" path="res://entities/weapons/space_gun/space_gun.tscn" id="9_achlo"]
[ext_resource type="Texture2D" uid="uid://doxo4vfn0bjlp" path="res://entities/player/assets/jetpackfx/smoke_02.png" id="10_5b1bx"]
[ext_resource type="Texture2D" uid="uid://dmf12llra7aq5" path="res://entities/player/assets/jetpackfx/Particle01.png" id="11_6ndfi"]
[ext_resource type="Script" path="res://addons/smoothing/smoothing.gd" id="11_k330l"]
[ext_resource type="Texture2D" uid="uid://ct1v5iadtpadm" path="res://entities/player/assets/jetpackfx/smoke_01.png" id="12_ypuho"]
[ext_resource type="Texture2D" uid="uid://doxo4vfn0bjlp" path="res://entities/player/assets/jetpackfx/smoke_02.png" id="13_wvbf0"]
[ext_resource type="Script" path="res://entities/components/health_component.gd" id="14_ctgxn"]
[ext_resource type="Texture2D" uid="uid://dmf12llra7aq5" path="res://entities/player/assets/jetpackfx/Particle01.png" id="14_vughy"]
[ext_resource type="PackedScene" uid="uid://b0xql5hi0b52y" path="res://entities/weapons/chaingun/chaingun.tscn" id="15_io0a3"]
[ext_resource type="PackedScene" uid="uid://cstl7yxc75572" path="res://entities/weapons/grenade_launcher/grenade_launcher.tscn" id="16_4xs2j"]
[ext_resource type="PackedScene" uid="uid://d3l7fvbdg6m5g" path="res://entities/flag/assets/flag.glb" id="18_7nkei"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_clur0"]
resource_local_to_scene = true
@ -29,26 +32,26 @@ resource_name = "death"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Smoothing/SpringArm3D:position")
tracks/0/path = NodePath("Pivot:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0.5, 0), Vector3(0, -0.114794, 0)]
"values": [Vector3(0, 0, 0), Vector3(-1.35254, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Smoothing/SpringArm3D:rotation")
tracks/1/path = NodePath("Pivot:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(-1.35254, 0, 0)]
"values": [Vector3(0, 0.5, 0), Vector3(0, -0.114794, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hg307"]
@ -58,16 +61,16 @@ _data = {
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rqdp6"]
properties/0/path = NodePath(".:linear_velocity")
properties/0/spawn = true
properties/0/spawn = false
properties/0/replication_mode = 1
properties/1/path = NodePath(".:position")
properties/1/spawn = true
properties/1/spawn = false
properties/1/replication_mode = 1
properties/2/path = NodePath("HealthComponent:health")
properties/2/spawn = true
properties/2/spawn = false
properties/2/replication_mode = 2
properties/3/path = NodePath(".:player_state")
properties/3/spawn = true
properties/3/spawn = false
properties/3/replication_mode = 2
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_5j4ew"]
@ -84,6 +87,17 @@ properties/3/path = NodePath(".:skiing")
properties/3/spawn = false
properties/3/replication_mode = 2
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_7na0c"]
properties/0/path = NodePath("MatchParticipantComponent:player_id")
properties/0/spawn = false
properties/0/replication_mode = 2
properties/1/path = NodePath("MatchParticipantComponent:team_id")
properties/1/spawn = false
properties/1/replication_mode = 2
properties/2/path = NodePath("MatchParticipantComponent:nickname")
properties/2/spawn = false
properties/2/replication_mode = 2
[sub_resource type="Gradient" id="Gradient_3u0pn"]
offsets = PackedFloat32Array(0, 0.872727)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
@ -113,7 +127,7 @@ color_ramp = SubResource("GradientTexture1D_wjoiw")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_27esd"]
transparency = 1
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("12_ypuho")
albedo_texture = ExtResource("9_4pant")
billboard_mode = 1
billboard_keep_scale = true
@ -141,7 +155,7 @@ color_ramp = SubResource("GradientTexture1D_ovx5q")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bknuu"]
transparency = 1
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("13_wvbf0")
albedo_texture = ExtResource("10_5b1bx")
billboard_mode = 1
billboard_keep_scale = true
grow_amount = 1.506
@ -180,7 +194,7 @@ transparency = 1
blend_mode = 1
cull_mode = 2
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("14_vughy")
albedo_texture = ExtResource("11_6ndfi")
emission_enabled = true
emission = Color(1, 0.823529, 0.701961, 1)
billboard_mode = 3
@ -192,7 +206,7 @@ particles_anim_loop = false
[sub_resource type="QuadMesh" id="QuadMesh_uc7ts"]
material = SubResource("StandardMaterial3D_2jwv2")
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff")]
[node name="Player" type="RigidBody3D" node_paths=PackedStringArray("iff", "health_component", "walkable_surface_sensor", "inventory", "tp_mesh") groups=["Player"]]
collision_mask = 2147483649
axis_lock_angular_x = true
axis_lock_angular_y = true
@ -203,17 +217,12 @@ can_sleep = false
continuous_cd = true
script = ExtResource("1_mk68k")
iff = NodePath("Smoothing/ThirdPerson/IFF")
health_component = NodePath("HealthComponent")
walkable_surface_sensor = NodePath("WalkableSurfaceSensor")
inventory = NodePath("Pivot/Inventory")
tp_mesh = NodePath("Smoothing/ThirdPerson/Mesh")
jump_height = 1.5
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = ExtResource("2_vjqny")
[node name="WalkableSurfaceSensor" type="ShapeCast3D" parent="."]
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, -0.85, 0)
shape = SubResource("SphereShape3D_hwe6e")
target_position = Vector3(0, 0, 0)
collision_mask = 2147483648
[node name="Sensor" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 8
@ -229,6 +238,15 @@ match_participant_component = NodePath("../MatchParticipantComponent")
[node name="CollisionShape3D" type="CollisionShape3D" parent="HealthComponent"]
shape = ExtResource("2_vjqny")
[node name="WalkableSurfaceSensor" type="ShapeCast3D" parent="."]
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, -0.85, 0)
shape = SubResource("SphereShape3D_hwe6e")
target_position = Vector3(0, 0, 0)
collision_mask = 2147483648
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = ExtResource("2_vjqny")
[node name="HUD" parent="." instance=ExtResource("3_ccety")]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
@ -247,73 +265,175 @@ replication_config = SubResource("SceneReplicationConfig_5j4ew")
script = ExtResource("6_ymcrr")
[node name="MatchParticipantComponent" type="MultiplayerSynchronizer" parent="."]
root_path = NodePath(".")
replication_config = SubResource("SceneReplicationConfig_7na0c")
script = ExtResource("6_lrose")
[node name="Pivot" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="Camera3D" type="Camera3D" parent="Pivot"]
fov = 90.0
near = 0.1
[node name="Inventory" type="Node3D" parent="Pivot"]
unique_name_in_owner = true
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.15, -0.2, -0.45)
script = ExtResource("8_768qh")
[node name="SpaceGun" parent="Pivot/Inventory" instance=ExtResource("9_achlo")]
[node name="ChainGun" parent="Pivot/Inventory" instance=ExtResource("15_io0a3")]
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0.1)
visible = false
[node name="GrenadeLauncher" parent="Pivot/Inventory" instance=ExtResource("16_4xs2j")]
visible = false
[node name="FlagCarryComponent" type="Node3D" parent="Pivot" node_paths=PackedStringArray("sensor", "carrier")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
visible = false
script = ExtResource("8_pdfbn")
sensor = NodePath("../../Sensor")
carrier = NodePath("../..")
[node name="FlagMesh" parent="Pivot/FlagCarryComponent" instance=ExtResource("18_7nkei")]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.559e-08, -0.462981, -0.178329)
[node name="SpineIKTarget" type="Marker3D" parent="Pivot"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
[node name="Smoothing" type="Node3D" parent="."]
script = ExtResource("11_k330l")
target = NodePath("..")
flags = 3
[node name="SpringArm3D" type="SpringArm3D" parent="Smoothing"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
spring_length = 0.0
[node name="Camera3D" type="Camera3D" parent="Smoothing/SpringArm3D"]
fov = 90.0
near = 0.1
[node name="Inventory" type="Node3D" parent="Smoothing/SpringArm3D"]
unique_name_in_owner = true
[node name="SpaceGun" parent="Smoothing/SpringArm3D/Inventory" node_paths=PackedStringArray("holder") instance=ExtResource("4_6jh57")]
transform = Transform3D(-1, 0, 2.53518e-06, 0, 1, 0, -2.53518e-06, 0, -1, 0.15, -0.3, -0.55)
holder = NodePath("../../../../MatchParticipantComponent")
[node name="SpineIKTarget" type="Node3D" parent="Smoothing/SpringArm3D"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
[node name="FlagCarryComponent" type="Node3D" parent="Smoothing/SpringArm3D" node_paths=PackedStringArray("sensor", "carrier")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
visible = false
script = ExtResource("8_pdfbn")
sensor = NodePath("../../../Sensor")
carrier = NodePath("../../..")
[node name="FlagMesh" parent="Smoothing/SpringArm3D/FlagCarryComponent" instance=ExtResource("9_fce2y")]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.559e-08, -0.462981, -0.178329)
[node name="ThirdPerson" type="Node3D" parent="Smoothing"]
visible = false
[node name="PlayerMesh" parent="Smoothing/ThirdPerson" node_paths=PackedStringArray("spine_ik_target_attachment") instance=ExtResource("2_beyex")]
[node name="Mesh" parent="Smoothing/ThirdPerson" node_paths=PackedStringArray("spine_ik_target_attachment") instance=ExtResource("8_eiy7q")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
spine_ik_target_attachment = NodePath("../../SpringArm3D/SpineIKTarget")
spine_ik_target_attachment = NodePath("../../../Pivot/SpineIKTarget")
[node name="JetpackFX" type="Node3D" parent="Smoothing/ThirdPerson/PlayerMesh"]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.187666, 0.238235, -0.147731)
[node name="Skeleton3D" parent="Smoothing/ThirdPerson/Mesh/Node" index="0"]
bones/0/position = Vector3(-0.0048219, 0.946668, 0.00678214)
bones/0/rotation = Quaternion(-0.0341192, -0.409249, -0.0209221, 0.911545)
bones/2/rotation = Quaternion(-0.00595832, -0.0014545, 0.0101407, 0.99993)
bones/4/rotation = Quaternion(0.0691268, 0.00227406, 0.0147948, 0.997496)
bones/6/rotation = Quaternion(0.160951, 0.00623474, 0.0096637, 0.986895)
bones/8/rotation = Quaternion(0.675761, -0.399581, 0.409695, 0.464577)
bones/10/rotation = Quaternion(0.212344, -0.0870591, -0.287653, 0.929831)
bones/12/rotation = Quaternion(0.0811501, 0.206806, -0.754068, 0.618084)
bones/14/position = Vector3(-0.074525, 0.220475, 0.075475)
bones/14/rotation = Quaternion(0.00943715, 0.0971687, -0.145046, 0.984597)
bones/20/rotation = Quaternion(-0.123455, 0.0248346, 0.23344, 0.964183)
bones/24/rotation = Quaternion(0.0450683, -0.000817796, 0.0508488, 0.997689)
bones/26/rotation = Quaternion(0.100545, -1.16532e-07, 0.00792588, 0.994901)
bones/28/rotation = Quaternion(0.288532, -1.83796e-07, 0.0227447, 0.9572)
bones/32/rotation = Quaternion(0.00674081, -0.0316083, 0.105474, 0.993897)
bones/34/rotation = Quaternion(0.780684, 4.23384e-08, 0.0615407, 0.621889)
bones/36/rotation = Quaternion(0.580978, -1.56224e-07, 0.0457976, 0.81263)
bones/40/rotation = Quaternion(0.0913739, 0.113691, 0.100265, 0.984211)
bones/42/rotation = Quaternion(0.836841, 4.40546e-07, 0.0659669, 0.543457)
bones/44/rotation = Quaternion(0.633142, 6.48257e-09, 0.04991, 0.772425)
bones/50/rotation = Quaternion(0.729888, -4.88266e-08, 0.0575362, 0.681141)
bones/52/rotation = Quaternion(0.624011, -9.63141e-08, 0.04919, 0.779865)
bones/56/rotation = Quaternion(-0.0254885, 0.0439755, -0.00910637, 0.998666)
bones/58/rotation = Quaternion(-0.0119802, 0.289956, -0.0527053, 0.955513)
bones/62/rotation = Quaternion(0.689943, 0.375565, -0.410267, 0.463261)
bones/64/rotation = Quaternion(0.337746, -0.290519, 0.159479, 0.880961)
bones/66/position = Vector3(0.055475, 0.231475, 0.000474975)
bones/66/rotation = Quaternion(0.540371, -0.580679, 0.406779, 0.453147)
bones/68/position = Vector3(-0.014525, 0.270475, -0.054525)
bones/68/rotation = Quaternion(0.0150529, -0.289001, 0.0720108, 0.954498)
bones/70/rotation = Quaternion(0.155965, 0.0109114, -0.00107202, 0.987702)
bones/72/rotation = Quaternion(0.563923, 4.19095e-08, -0.0577906, 0.823803)
bones/74/rotation = Quaternion(0.285209, 0.0197164, -0.0936782, 0.953673)
bones/78/rotation = Quaternion(0.057484, -0.0698946, -0.0100642, 0.995846)
bones/80/rotation = Quaternion(0.433127, 5.44824e-08, -0.0443866, 0.900239)
bones/82/rotation = Quaternion(0.274138, -1.97906e-08, -0.0280937, 0.96128)
bones/86/rotation = Quaternion(0.244152, 0.0521336, 0.176446, 0.952123)
bones/88/rotation = Quaternion(0.0146391, -1.48637e-07, -0.121951, 0.992428)
bones/90/rotation = Quaternion(-0.147655, -0.0737763, 0.197847, 0.966236)
bones/94/rotation = Quaternion(0.180682, 0.0832945, -0.00387314, 0.980001)
bones/96/rotation = Quaternion(0.245651, -6.35919e-08, -0.0251742, 0.969032)
bones/98/rotation = Quaternion(0.246432, 7.6252e-08, -0.0252543, 0.968831)
bones/102/rotation = Quaternion(0.179829, 0.0890365, -0.000307644, 0.97966)
bones/104/rotation = Quaternion(0.388149, 1.28057e-07, -0.0397774, 0.920738)
bones/106/rotation = Quaternion(0.372324, -1.37021e-07, -0.0381557, 0.927318)
bones/110/rotation = Quaternion(-0.167577, 0.223934, 0.958827, 0.0492099)
bones/112/rotation = Quaternion(-0.466474, -0.0088339, -0.0232928, 0.884184)
bones/114/rotation = Quaternion(0.575696, 0.0793941, -0.0250592, 0.813414)
bones/116/rotation = Quaternion(0.355062, 0.0493655, 0.0246355, 0.933213)
bones/120/rotation = Quaternion(0.115252, 0.282473, 0.945749, -0.111737)
bones/122/rotation = Quaternion(-0.494906, -0.0647935, 0.0183973, 0.866332)
bones/124/rotation = Quaternion(0.417677, -0.0431149, 0.00625689, 0.90755)
bones/126/rotation = Quaternion(0.397818, -0.0427722, -0.00601182, 0.916447)
[node name="Smoke1" type="GPUParticles3D" parent="Smoothing/ThirdPerson/PlayerMesh/JetpackFX"]
[node name="HandAttachment" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D" index="0"]
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.191759, 1.06335, 0.0698007)
[node name="grip" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="main" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="sides" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="BarrelsInner" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsOuter" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Base" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Grip" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Barrels" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun" index="3"]
transform = Transform3D(-1, 0, 8.9407e-08, 8.47504e-08, 0, 1, 0, 1, -3.72529e-09, 0, -2.38419e-07, -0.55315)
[node name="barrel" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="grip" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.082471, -0.0653242)
[node name="main" parent="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="JetpackFX" type="Node3D" parent="Smoothing/ThirdPerson/Mesh"]
transform = Transform3D(0.467164, -0.312366, -0.827155, -0.12476, 0.902867, -0.41142, 0.875325, 0.295397, 0.382816, 0.143745, 0.353192, -0.140279)
[node name="Smoke1" type="GPUParticles3D" parent="Smoothing/ThirdPerson/Mesh/JetpackFX"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.150648, 0)
emitting = false
lifetime = 0.5
one_shot = true
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_v556h")
draw_pass_1 = SubResource("QuadMesh_hegkl")
[node name="Smoke2" type="GPUParticles3D" parent="Smoothing/ThirdPerson/PlayerMesh/JetpackFX"]
[node name="Smoke2" type="GPUParticles3D" parent="Smoothing/ThirdPerson/Mesh/JetpackFX"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.108846, 0)
emitting = false
lifetime = 0.5
one_shot = true
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_l8e6j")
draw_pass_1 = SubResource("QuadMesh_aeure")
[node name="Fire1" type="GPUParticles3D" parent="Smoothing/ThirdPerson/PlayerMesh/JetpackFX"]
[node name="Fire1" type="GPUParticles3D" parent="Smoothing/ThirdPerson/Mesh/JetpackFX"]
emitting = false
amount = 16
lifetime = 0.3
one_shot = true
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_q1vdw")
draw_pass_1 = SubResource("QuadMesh_uc7ts")
@ -324,3 +444,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.27457, 0)
player = NodePath("../../..")
match_participant_component = NodePath("../../../MatchParticipantComponent")
attach_point = NodePath("../IFFAttachment")
[connection signal="energy_changed" from="." to="HUD" method="_on_player_energy_changed"]
[editable path="Smoothing/ThirdPerson/Mesh"]
[editable path="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun"]
[editable path="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh"]
[editable path="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun"]
[editable path="Smoothing/ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher"]

View file

@ -18,21 +18,16 @@ class_name PlayerInput extends MultiplayerSynchronizer
@export var skiing : bool = false
@export var direction : Vector2 = Vector2.ZERO
@export var camera_rotation : Vector2
@export var MOUSE_SENSITIVITY : float = .6
@export var inverted_y_axis : bool = false
signal jumped
signal fired_primary
signal throwed_flag
func _ready() -> void:
func _enter_tree() -> void:
update_multiplayer_authority(0)
func update_multiplayer_authority(player_id : int) -> void:
set_multiplayer_authority(player_id)
var has_authority : bool = is_multiplayer_authority()
set_process(has_authority)
set_process_unhandled_input(has_authority)
func _unhandled_input(event: InputEvent) -> void:
var mouse_mode : Input.MouseMode = Input.get_mouse_mode()
@ -41,37 +36,55 @@ func _unhandled_input(event: InputEvent) -> void:
if mouse_mode == Input.MOUSE_MODE_CAPTURED:
# retrieve mouse position relative to last frame
_update_camera(event.relative)
if is_multiplayer_authority():
if event is InputEventMouseButton:
# @NOTE: there could be a control setting for direction
if event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed:
_cycle.rpc(1)
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN and event.pressed:
_cycle.rpc(-1)
if event is InputEventKey:
match event.keycode:
KEY_1: _select.rpc(0)
KEY_2: _select.rpc(1)
KEY_3: _select.rpc(2)
direction = Input.get_vector("left", "right", "forward", "backward")
if Input.is_action_just_pressed("jump_and_jet"):
_jump.rpc()
if Input.is_action_just_pressed("fire_primary"):
_fire_primary.rpc()
if Input.is_action_just_pressed("throw_flag"):
_throw_flag.rpc()
jetting = Input.is_action_pressed("jump_and_jet")
skiing = Input.is_action_pressed("ski")
func _update_camera(relative_motion : Vector2) -> void:
# reverse y axis
if inverted_y_axis:
if Settings.get_value("controls", "inverted_y_axis"):
relative_motion.y *= -1.0
# clamp vertical rotation (head motion)
camera_rotation.y -= relative_motion.y * MOUSE_SENSITIVITY / 100
camera_rotation.y -= relative_motion.y * Settings.get_value("controls", "mouse_sensitivity") / 100
camera_rotation.y = clamp(camera_rotation.y, deg_to_rad(-90.0), deg_to_rad(90.0))
# wrap horizontal rotation (to prevent accumulation)
camera_rotation.x -= relative_motion.x * MOUSE_SENSITIVITY / 100
camera_rotation.x -= relative_motion.x * Settings.get_value("controls", "mouse_sensitivity") / 100
camera_rotation.x = wrapf(camera_rotation.x, deg_to_rad(0.0), deg_to_rad(360.0))
func _process(_delta : float) -> void:
direction = Input.get_vector("left", "right", "forward", "backward")
if Input.is_action_just_pressed("jump_and_jet"):
_jump.rpc()
if Input.is_action_just_pressed("fire_primary"):
_fire_primary.rpc()
if Input.is_action_just_pressed("throw_flag"):
_throw_flag.rpc()
jetting = Input.is_action_pressed("jump_and_jet")
skiing = Input.is_action_pressed("ski")
@rpc("call_local")
@rpc("call_local", "reliable")
func _jump() -> void:
jumped.emit()
@rpc("call_local")
@rpc("call_local", "reliable")
func _fire_primary() -> void:
fired_primary.emit()
@rpc("call_local")
@rpc("call_local", "reliable")
func _cycle(shift : int) -> void:
%Inventory.cycle(shift)
@rpc("call_local", "reliable")
func _select(index : int) -> void:
%Inventory.select(index)
@rpc("call_local", "reliable")
func _throw_flag() -> void:
throwed_flag.emit()

View file

@ -1,6 +1,7 @@
class_name Vanguard extends Node
@export var spine_ik_target_attachment : Node3D
@export var spine_ik_target_attachment : Marker3D
@export var hand_attachment : BoneAttachment3D
@onready var animation_tree : AnimationTree = $AnimationTree
@onready var spine_ik : SkeletonIK3D = $Node/Skeleton3D/SpineIK

View file

@ -0,0 +1,230 @@
[gd_scene load_steps=20 format=3 uid="uid://drbefw6akui2v"]
[ext_resource type="PackedScene" uid="uid://4naw661fqmjg" path="res://entities/player/assets/vanguard.glb" id="1_d2ik6"]
[ext_resource type="Script" path="res://entities/player/vanguard.gd" id="2_c22xr"]
[ext_resource type="PackedScene" uid="uid://c8co0qa2omjmh" path="res://entities/weapons/space_gun/space_gun.tscn" id="3_cfjna"]
[ext_resource type="PackedScene" uid="uid://b0xql5hi0b52y" path="res://entities/weapons/chaingun/chaingun.tscn" id="4_0qqks"]
[ext_resource type="PackedScene" uid="uid://cstl7yxc75572" path="res://entities/weapons/grenade_launcher/grenade_launcher.tscn" id="5_p6n3u"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lw37l"]
animation = &"death"
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_ncg4i"]
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_ugw6e"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dyfkg"]
animation = &"jump"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_x158p"]
animation = &"jump_up"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_l3m4j"]
animation = &"run_right"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a1e0h"]
animation = &"run_backward"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_sjcrs"]
animation = &"run_left"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vf3mp"]
animation = &"run_forward"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_n6f67"]
animation = &"idle"
[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_oxci6"]
blend_point_0/node = SubResource("AnimationNodeAnimation_l3m4j")
blend_point_0/pos = Vector2(-1, 0)
blend_point_1/node = SubResource("AnimationNodeAnimation_a1e0h")
blend_point_1/pos = Vector2(0, -1)
blend_point_2/node = SubResource("AnimationNodeAnimation_sjcrs")
blend_point_2/pos = Vector2(1, 0)
blend_point_3/node = SubResource("AnimationNodeAnimation_vf3mp")
blend_point_3/pos = Vector2(0, 1)
blend_point_4/node = SubResource("AnimationNodeAnimation_n6f67")
blend_point_4/pos = Vector2(0, 0)
sync = true
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_ax6or"]
[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_c220w"]
xfade_time = 0.1
input_0/name = "grounded"
input_0/auto_advance = false
input_0/reset = true
input_1/name = "mid_air"
input_1/auto_advance = false
input_1/reset = true
input_2/name = "dead"
input_2/auto_advance = false
input_2/reset = true
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_1ok7t"]
nodes/Death/node = SubResource("AnimationNodeOneShot_ncg4i")
nodes/Death/position = Vector2(880, 500)
"nodes/Death 2/node" = SubResource("AnimationNodeAnimation_lw37l")
"nodes/Death 2/position" = Vector2(674.414, 529.106)
nodes/GroundSpeed/node = SubResource("AnimationNodeTimeScale_ugw6e")
nodes/GroundSpeed/position = Vector2(920, 20)
nodes/JumpLoop/node = SubResource("AnimationNodeAnimation_dyfkg")
nodes/JumpLoop/position = Vector2(500, 400)
nodes/JumpUp/node = SubResource("AnimationNodeAnimation_x158p")
nodes/JumpUp/position = Vector2(500, 240)
nodes/Locomotion/node = SubResource("AnimationNodeBlendSpace2D_oxci6")
nodes/Locomotion/position = Vector2(680, 40)
nodes/OneShot/node = SubResource("AnimationNodeOneShot_ax6or")
nodes/OneShot/position = Vector2(880, 240)
nodes/Transition/node = SubResource("AnimationNodeTransition_c220w")
nodes/Transition/position = Vector2(1200, 80)
nodes/output/position = Vector2(1400, 0)
node_connections = [&"Death", 0, &"Death 2", &"GroundSpeed", 0, &"Locomotion", &"OneShot", 0, &"JumpUp", &"OneShot", 1, &"JumpLoop", &"Transition", 0, &"GroundSpeed", &"Transition", 1, &"OneShot", &"Transition", 2, &"Death", &"output", 0, &"Transition"]
[node name="Vanguard" node_paths=PackedStringArray("spine_ik_target_attachment", "hand_attachment") instance=ExtResource("1_d2ik6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.61612e-06, 0.000176162, 0.000105232)
script = ExtResource("2_c22xr")
spine_ik_target_attachment = NodePath("SpineIKTarget")
hand_attachment = NodePath("Node/Skeleton3D/HandAttachment")
[node name="Skeleton3D" parent="Node" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00146306, 0, -0.00178421)
bones/0/position = Vector3(-0.0048219, 0.946668, 0.00678214)
bones/0/rotation = Quaternion(-0.0341192, -0.409249, -0.0209221, 0.911545)
bones/2/rotation = Quaternion(-0.00595832, -0.0014545, 0.0101407, 0.99993)
bones/4/rotation = Quaternion(0.0691268, 0.00227406, 0.0147948, 0.997496)
bones/6/rotation = Quaternion(0.160951, 0.00623474, 0.0096637, 0.986895)
bones/8/rotation = Quaternion(0.675761, -0.399581, 0.409695, 0.464577)
bones/10/rotation = Quaternion(0.212344, -0.0870591, -0.287653, 0.929831)
bones/12/rotation = Quaternion(0.0811501, 0.206806, -0.754068, 0.618084)
bones/14/rotation = Quaternion(0.00943715, 0.0971687, -0.145046, 0.984597)
bones/20/rotation = Quaternion(-0.123455, 0.0248346, 0.23344, 0.964183)
bones/24/rotation = Quaternion(0.0450683, -0.000817796, 0.0508488, 0.997689)
bones/26/rotation = Quaternion(0.100545, -1.16532e-07, 0.00792588, 0.994901)
bones/28/rotation = Quaternion(0.288532, -1.83796e-07, 0.0227447, 0.9572)
bones/32/rotation = Quaternion(0.00674081, -0.0316083, 0.105474, 0.993897)
bones/34/rotation = Quaternion(0.780684, 4.23384e-08, 0.0615407, 0.621889)
bones/36/rotation = Quaternion(0.580978, -1.56224e-07, 0.0457976, 0.81263)
bones/40/rotation = Quaternion(0.0913739, 0.113691, 0.100265, 0.984211)
bones/42/rotation = Quaternion(0.836841, 4.40546e-07, 0.0659669, 0.543457)
bones/44/rotation = Quaternion(0.633142, 6.48257e-09, 0.04991, 0.772425)
bones/50/rotation = Quaternion(0.729888, -4.88266e-08, 0.0575362, 0.681141)
bones/52/rotation = Quaternion(0.624011, -9.63141e-08, 0.04919, 0.779865)
bones/54/rotation = Quaternion(-1.18924e-16, 2.81961e-21, -4.50738e-10, 1)
bones/56/rotation = Quaternion(-0.0254885, 0.0439755, -0.00910637, 0.998666)
bones/58/rotation = Quaternion(-0.0119802, 0.289956, -0.0527053, 0.955513)
bones/62/rotation = Quaternion(0.689943, 0.375565, -0.410267, 0.463261)
bones/64/rotation = Quaternion(0.337746, -0.290519, 0.159479, 0.880961)
bones/66/rotation = Quaternion(0.540371, -0.580679, 0.406779, 0.453147)
bones/68/position = Vector3(0.000474975, 0.275475, 0.035475)
bones/68/rotation = Quaternion(0.0150529, -0.289001, 0.0720108, 0.954498)
bones/70/rotation = Quaternion(0.155965, 0.0109114, -0.00107202, 0.987702)
bones/72/rotation = Quaternion(0.563923, 4.19095e-08, -0.0577906, 0.823803)
bones/74/rotation = Quaternion(0.285209, 0.0197164, -0.0936782, 0.953673)
bones/78/rotation = Quaternion(0.057484, -0.0698946, -0.0100642, 0.995846)
bones/80/rotation = Quaternion(0.433127, 5.44824e-08, -0.0443866, 0.900239)
bones/82/rotation = Quaternion(0.274138, -1.97906e-08, -0.0280937, 0.96128)
bones/86/rotation = Quaternion(0.244152, 0.0521336, 0.176446, 0.952123)
bones/88/rotation = Quaternion(0.0146391, -1.48637e-07, -0.121951, 0.992428)
bones/90/rotation = Quaternion(-0.147655, -0.0737763, 0.197847, 0.966236)
bones/94/rotation = Quaternion(0.180682, 0.0832945, -0.00387314, 0.980001)
bones/96/rotation = Quaternion(0.245651, -6.35919e-08, -0.0251742, 0.969032)
bones/98/rotation = Quaternion(0.246432, 7.6252e-08, -0.0252543, 0.968831)
bones/100/rotation = Quaternion(-6.44756e-14, -1.4372e-11, -3.12192e-10, 1)
bones/102/rotation = Quaternion(0.179829, 0.0890365, -0.000307644, 0.97966)
bones/104/rotation = Quaternion(0.388149, 1.28057e-07, -0.0397774, 0.920738)
bones/106/rotation = Quaternion(0.372324, -1.37021e-07, -0.0381557, 0.927318)
bones/110/rotation = Quaternion(-0.167577, 0.223934, 0.958827, 0.0492099)
bones/112/rotation = Quaternion(-0.466474, -0.0088339, -0.0232928, 0.884184)
bones/114/rotation = Quaternion(0.575696, 0.0793941, -0.0250592, 0.813414)
bones/116/rotation = Quaternion(0.355062, 0.0493655, 0.0246355, 0.933213)
bones/120/rotation = Quaternion(0.115252, 0.282473, 0.945749, -0.111737)
bones/122/rotation = Quaternion(-0.494906, -0.0647935, 0.0183973, 0.866332)
bones/124/rotation = Quaternion(0.417677, -0.0431149, 0.00625689, 0.90755)
bones/126/rotation = Quaternion(0.397818, -0.0427722, -0.00601182, 0.916447)
[node name="HandAttachment" type="BoneAttachment3D" parent="Node/Skeleton3D" index="0"]
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896011)
bone_name = "mixamorigRightHand"
bone_idx = 14
[node name="SpaceGun" parent="Node/Skeleton3D/HandAttachment" index="0" instance=ExtResource("3_cfjna")]
transform = Transform3D(-0.170368, 0.95438, -0.24522, -0.0464896, 0.240797, 0.969461, 0.984283, 0.176566, 0.00334465, 0.0409744, 0.381457, 0.0445086)
script = null
[node name="grip" parent="Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="main" parent="Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="sides" parent="Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.84217e-14, 1.19209e-07, 2.38419e-07)
[node name="ChainGun" parent="Node/Skeleton3D/HandAttachment" index="1" instance=ExtResource("4_0qqks")]
transform = Transform3D(-0.0425921, 0.235665, -0.0717487, -0.0116224, 0.0708099, 0.23948, 0.246071, 0.0441354, -0.00110777, -0.00204359, 0.464663, 0.0585247)
visible = false
script = null
[node name="BarrelsInner" parent="Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsOuter" parent="Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Base" parent="Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Grip" parent="Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Barrels" parent="Node/Skeleton3D/HandAttachment/ChainGun" index="3"]
transform = Transform3D(-1, -7.45058e-09, 8.70787e-08, 8.56817e-08, 3.72529e-09, 1, 0, 1, 0, 0, -1.19209e-07, -0.55315)
[node name="GrenadeLauncher" parent="Node/Skeleton3D/HandAttachment" index="2" instance=ExtResource("5_p6n3u")]
transform = Transform3D(-0.170368, 0.95438, -0.24522, -0.0464896, 0.240797, 0.969461, 0.984283, 0.176566, 0.00334465, 0.0409744, 0.381457, 0.0445086)
visible = false
script = null
[node name="barrel" parent="Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="grip" parent="Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.082471, -0.0653242)
[node name="main" parent="Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="SpineIK" type="SkeletonIK3D" parent="Node/Skeleton3D" index="3"]
process_priority = 1
root_bone = &"mixamorigHips"
tip_bone = &"mixamorigSpine2"
override_tip_basis = false
target_node = NodePath("../../../SpineIKTarget")
[node name="AnimationPlayer" parent="." index="1"]
autoplay = "idle"
playback_default_blend_time = 0.2
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeBlendTree_1ok7t")
anim_player = NodePath("../AnimationPlayer")
parameters/Death/active = false
parameters/Death/internal_active = false
parameters/Death/request = 0
parameters/GroundSpeed/scale = 0.0
parameters/Locomotion/blend_position = Vector2(0.0952381, 0.280822)
parameters/OneShot/active = false
parameters/OneShot/internal_active = false
parameters/OneShot/request = 0
parameters/Transition/current_state = "grounded"
parameters/Transition/transition_request = ""
parameters/Transition/current_index = 0
[node name="SpineIKTarget" type="Marker3D" parent="." index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.479842, 0)
[editable path="Node/Skeleton3D/HandAttachment/SpaceGun"]
[editable path="Node/Skeleton3D/HandAttachment/SpaceGun/Mesh"]
[editable path="Node/Skeleton3D/HandAttachment/ChainGun"]
[editable path="Node/Skeleton3D/HandAttachment/GrenadeLauncher"]