Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a257306999 | |||
| 2e5fcb6a75 | |||
| 87a9fad005 | |||
| 837b3d7705 |
@@ -20,7 +20,6 @@ public partial class CHealth : Node, IHealthable
|
||||
|
||||
public void ReduceHealth(IDamageable source, DamageRecord damageRecord)
|
||||
{
|
||||
GD.Print(CurrentHealth);
|
||||
CurrentHealth -= damageRecord.Damage.DamageDealt;
|
||||
HealthChanged?.Invoke(this, CurrentHealth);
|
||||
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
[gd_scene load_steps=52 format=3 uid="uid://bei4nhkf8lwdo"]
|
||||
[gd_scene load_steps=55 format=3 uid="uid://bei4nhkf8lwdo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
|
||||
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
|
||||
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"]
|
||||
[ext_resource type="Script" uid="uid://b0u23nkpaimyc" path="res://components/damage/CDamageable.cs" id="4_q7bng"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4ikbhojckpnc" path="res://components/health/CHealth.tscn" id="3_q7bng"]
|
||||
[ext_resource type="Resource" uid="uid://bjyd801wvverk" path="res://player_controller/resources/player_health.tres" id="4_m8gvy"]
|
||||
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
|
||||
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
|
||||
[ext_resource type="Script" uid="uid://b6y3ugfydvch0" path="res://components/damage/RDamageModifier.cs" id="5_q7bng"]
|
||||
[ext_resource type="PackedScene" uid="uid://hpsg4fqwrx1u" path="res://components/damage/CDamageable.tscn" id="5_jb43f"]
|
||||
[ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://systems/inputs/base_mode/move_left.tres" id="5_q14ux"]
|
||||
[ext_resource type="Resource" uid="uid://dyru7mxo121w6" path="res://player_controller/resources/player_normal_damage_mod.tres" id="6_cmijs"]
|
||||
[ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://systems/inputs/base_mode/move_right.tres" id="6_q7bng"]
|
||||
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"]
|
||||
[ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://systems/inputs/base_mode/move_front.tres" id="7_m8gvy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bctpe34ddamg5" path="res://components/knockback/CKnockback.tscn" id="7_x835q"]
|
||||
[ext_resource type="Resource" uid="uid://s1l0n1iitc6m" path="res://systems/inputs/base_mode/move_back.tres" id="8_jb43f"]
|
||||
[ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/base_mode/aim_release.tres" id="8_lhb11"]
|
||||
[ext_resource type="Resource" uid="uid://bs8b0oojixm4q" path="res://player_controller/resources/player_knockback.tres" id="8_m8gvy"]
|
||||
[ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="8_obsfv"]
|
||||
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"]
|
||||
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
|
||||
@@ -43,11 +47,6 @@
|
||||
[ext_resource type="Texture2D" uid="uid://chvt6g0xn5c2m" path="res://systems/dash/light-ring.jpg" id="32_lgpc8"]
|
||||
[ext_resource type="Script" uid="uid://b4dwolbvt8our" path="res://addons/godot_state_charts/history_state.gd" id="41_ruloh"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jb43f"]
|
||||
script = ExtResource("5_q7bng")
|
||||
Modifier = 3.0
|
||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_xc2g5"]
|
||||
height = 1.7
|
||||
|
||||
@@ -77,10 +76,9 @@ radius = 0.4
|
||||
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_2q0ik"]
|
||||
blend_mode = 1
|
||||
|
||||
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("CDamage")]
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
collision_mask = 272
|
||||
script = ExtResource("1_poq2x")
|
||||
CDamage = NodePath("CDamageable")
|
||||
WalkSpeed = 7.5
|
||||
AccelerationFloor = 4.0
|
||||
DecelerationFloor = 3.0
|
||||
@@ -118,10 +116,14 @@ WallHugGravityLesseningFactor = 15.0
|
||||
WallHugDownwardMaxSpeed = 4.0
|
||||
WallHugHorizontalDeceleration = 1.0
|
||||
|
||||
[node name="CDamageable" type="Node" parent="."]
|
||||
script = ExtResource("4_q7bng")
|
||||
DamageModifiers = Array[Object]([SubResource("Resource_jb43f")])
|
||||
metadata/_custom_type_script = "uid://b0u23nkpaimyc"
|
||||
[node name="CHealth" parent="." instance=ExtResource("3_q7bng")]
|
||||
RHealth = ExtResource("4_m8gvy")
|
||||
|
||||
[node name="CDamageable" parent="." instance=ExtResource("5_jb43f")]
|
||||
DamageModifiers = Array[Object]([ExtResource("6_cmijs")])
|
||||
|
||||
[node name="CKnockback" parent="." instance=ExtResource("7_x835q")]
|
||||
RKnockback = ExtResource("8_m8gvy")
|
||||
|
||||
[node name="WallRunSnapper" type="RayCast3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
@@ -186,6 +188,7 @@ unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.6, 0)
|
||||
collision_layer = 0
|
||||
collision_mask = 16
|
||||
monitoring = false
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HeadSystem/WeaponHitbox"]
|
||||
@@ -301,6 +304,13 @@ collision_mask = 256
|
||||
target_position = Vector3(0, -2, 0)
|
||||
collision_mask = 256
|
||||
|
||||
[node name="InvincibilityTime" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[node name="AttackCooldown" type="Timer" parent="."]
|
||||
wait_time = 0.3
|
||||
one_shot = true
|
||||
|
||||
[node name="DashCooldown" type="Timer" parent="."]
|
||||
wait_time = 0.8
|
||||
one_shot = true
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
using GodotStateCharts;
|
||||
using Movementtests.addons.godot_state_charts.csharp;
|
||||
@@ -9,7 +11,9 @@ using RustyOptions;
|
||||
|
||||
public partial class PlayerController : CharacterBody3D,
|
||||
IDamageable,
|
||||
IDamageDealer
|
||||
IDamageDealer,
|
||||
IHealthable,
|
||||
IKnockbackable
|
||||
{
|
||||
// Enums
|
||||
public enum AllowedInputs
|
||||
@@ -36,6 +40,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
///////////////////////////
|
||||
|
||||
public event Action<IDamageable, DamageRecord> DamageTaken;
|
||||
public event Action<IHealthable, float> HealthChanged;
|
||||
public event Action<IHealthable> HealthDepleted;
|
||||
|
||||
///////////////////////////
|
||||
// Public stuff //
|
||||
@@ -68,9 +74,14 @@ public partial class PlayerController : CharacterBody3D,
|
||||
[ExportGroup("Damage")]
|
||||
[Export]
|
||||
public RDamage RDamage { get; set; }
|
||||
[Export]
|
||||
public CDamageable CDamage { get; set; }
|
||||
|
||||
[Export]
|
||||
public RKnockback RKnockback { get; set; }
|
||||
|
||||
[Export]
|
||||
public RHealth RHealth { get; set; }
|
||||
|
||||
// Movement stuff
|
||||
[ExportCategory("Movement")]
|
||||
[ExportGroup("Ground")]
|
||||
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
|
||||
@@ -172,7 +183,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
[Export(PropertyHint.Range, "1,10,0.1,or_greater")]
|
||||
public float GroundSlideSlopeMagnetism = 2f;
|
||||
|
||||
|
||||
[ExportSubgroup("Air glide")]
|
||||
[Export]
|
||||
public bool AllowForVelocityRedirection = true;
|
||||
@@ -208,8 +218,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
[Export(PropertyHint.Range, "1,20,0.1,or_greater")]
|
||||
public float WallRunSpeedThreshold { get; set; } = 8f;
|
||||
|
||||
|
||||
|
||||
///////////////////////////
|
||||
// Private stuff //
|
||||
///////////////////////////
|
||||
@@ -279,6 +288,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
private Timer _simpleDashCooldownTimer;
|
||||
private Timer _airborneDashCooldownTimer;
|
||||
private Timer _powerCooldownTimer;
|
||||
private Timer _invincibilityTimer;
|
||||
private Timer _attackCooldown;
|
||||
|
||||
// State chart
|
||||
private StateChart _playerState;
|
||||
@@ -316,6 +327,16 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
private Transition _onGroundSlideJump;
|
||||
private Transition _onAirGlideDoubleJump;
|
||||
|
||||
// Damage
|
||||
public CDamageable CDamageable { get; set; }
|
||||
public CHealth CHealth { get; set; }
|
||||
public CKnockback CKnockback { get; set; }
|
||||
public float CurrentHealth { get; set; }
|
||||
|
||||
private bool _isInvincible;
|
||||
private bool _canAttack = true;
|
||||
private readonly List<IDamageable> _hitEnemies = new List<IDamageable>();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -366,8 +387,29 @@ public partial class PlayerController : CharacterBody3D,
|
||||
var playerShape = StandingCollider.GetShape() as CapsuleShape3D;
|
||||
_playerHeight = playerShape!.Height;
|
||||
_playerRadius = playerShape.Radius;
|
||||
|
||||
|
||||
// Combat stuff
|
||||
WeaponHitbox = GetNode<Area3D>("%WeaponHitbox");
|
||||
WeaponHitbox.Monitoring = false;
|
||||
WeaponHitbox.BodyEntered += RegisterHitEnnemy;
|
||||
|
||||
CHealth = GetNode<Node>("CHealth") as CHealth;
|
||||
CKnockback = GetNode<Node>("CKnockback") as CKnockback;
|
||||
CDamageable = GetNode<Node>("CDamageable") as CDamageable;
|
||||
if (CHealth == null) throw new Exception("CHealth not found!");
|
||||
if (CKnockback == null) throw new Exception("CKnockback not found!");
|
||||
if (CDamageable == null) throw new Exception("CDamageable not found!");
|
||||
|
||||
if (RHealth != null)
|
||||
{
|
||||
CHealth.RHealth = RHealth;
|
||||
CHealth.CurrentHealth = RHealth.StartingHealth;
|
||||
}
|
||||
if (RKnockback != null) CKnockback!.RKnockback = RKnockback;
|
||||
|
||||
CDamageable.DamageTaken += ReduceHealth;
|
||||
CDamageable.DamageTaken += RegisterKnockback;
|
||||
CHealth.HealthDepleted += Kill;
|
||||
|
||||
// State management
|
||||
_playerState = StateChart.Of(GetNode("StateChart"));
|
||||
@@ -412,6 +454,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
|
||||
_simpleDashCooldownTimer = GetNode<Timer>("DashCooldown");
|
||||
_airborneDashCooldownTimer = GetNode<Timer>("AirborneDashCooldown");
|
||||
_invincibilityTimer = GetNode<Timer>("InvincibilityTime");
|
||||
_attackCooldown = GetNode<Timer>("AttackCooldown");
|
||||
|
||||
///////////////////////////
|
||||
// Initialize components //
|
||||
@@ -419,6 +463,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
// Camera stuff
|
||||
HeadSystem.Init();
|
||||
HeadSystem.HitboxActivated += OnHitboxActivated;
|
||||
HeadSystem.HitboxDeactivated += OnHitboxDeactivated;
|
||||
|
||||
// Movement stuff
|
||||
// Getting universal setting from GODOT editor to be in sync
|
||||
@@ -437,6 +483,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
///////////////////////////
|
||||
// Signal setup ///////////
|
||||
///////////////////////////
|
||||
_invincibilityTimer.Timeout += ResetInvincibility;
|
||||
_attackCooldown.Timeout += ResetAttackCooldown;
|
||||
|
||||
_aiming.StatePhysicsProcessing += HandleAiming;
|
||||
_aiming.StateEntered += OnAimingEntered;
|
||||
_aiming.StateExited += ResetTimeScale;
|
||||
@@ -1267,6 +1316,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
///////////////////////////
|
||||
|
||||
private bool _isSlideInputDown = false;
|
||||
|
||||
public void OnInputSlideStarted()
|
||||
{
|
||||
_isSlideInputDown = true;
|
||||
@@ -1701,6 +1751,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1;
|
||||
|
||||
LookAround(delta);
|
||||
Velocity += ComputeKnockback();
|
||||
MoveSlideAndHandleStairs((float) delta);
|
||||
MantleSystem.ProcessMantle(_grounded.Active);
|
||||
|
||||
@@ -1716,17 +1767,25 @@ public partial class PlayerController : CharacterBody3D,
|
||||
DashIndicatorNode.LookAt(WeaponSystem.GlobalPosition);
|
||||
}
|
||||
}
|
||||
|
||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
var finalDamage = CDamage.TakeDamage(damageRecord);
|
||||
DamageTaken?.Invoke(this, finalDamage);
|
||||
return finalDamage;
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
// Hit Management ///////
|
||||
///////////////////////////
|
||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
if (_isInvincible)
|
||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
||||
|
||||
var finalDamage = CDamageable.TakeDamage(damageRecord);
|
||||
DamageTaken?.Invoke(this, finalDamage);
|
||||
|
||||
TriggerHitstop();
|
||||
|
||||
_isInvincible = true;
|
||||
_invincibilityTimer.Start();
|
||||
|
||||
return finalDamage;
|
||||
}
|
||||
public void OnInputHitPressed()
|
||||
{
|
||||
if (_aiming.Active && WeaponSystem.InHandState.Active)
|
||||
@@ -1735,11 +1794,82 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
|
||||
if (!WeaponSystem.InHandState.Active) return;
|
||||
var bodies = WeaponHitbox.GetOverlappingBodies();
|
||||
foreach (var body in bodies)
|
||||
{
|
||||
if(body is IDamageable spawnable)
|
||||
spawnable.TakeDamage(new DamageRecord(this, RDamage));
|
||||
}
|
||||
if (!_canAttack) return;
|
||||
|
||||
_canAttack = false;
|
||||
_attackCooldown.Start();
|
||||
PerformHit();
|
||||
}
|
||||
|
||||
public void ResetAttackCooldown()
|
||||
{
|
||||
_canAttack = true;
|
||||
}
|
||||
|
||||
public void PerformHit()
|
||||
{
|
||||
HeadSystem.OnHit();
|
||||
}
|
||||
|
||||
public void OnHitboxActivated()
|
||||
{
|
||||
WeaponHitbox.Monitoring = true;
|
||||
}
|
||||
public void OnHitboxDeactivated()
|
||||
{
|
||||
WeaponHitbox.Monitoring = false;
|
||||
TriggerDamage();
|
||||
}
|
||||
|
||||
public void RegisterHitEnnemy(Node3D body)
|
||||
{
|
||||
if (body is not IDamageable damageable) return;
|
||||
_hitEnemies.Add(damageable);
|
||||
}
|
||||
|
||||
public void TriggerDamage()
|
||||
{
|
||||
if (_hitEnemies.Count == 0) return;
|
||||
|
||||
foreach (var damageable in _hitEnemies)
|
||||
damageable.TakeDamage(new DamageRecord(this, RDamage));
|
||||
_hitEnemies.Clear();
|
||||
TriggerHitstop();
|
||||
}
|
||||
|
||||
public void TriggerHitstop()
|
||||
{
|
||||
Engine.SetTimeScale(0.01);
|
||||
var timer = GetTree().CreateTimer(0.1, true, false, true);
|
||||
timer.Timeout += OnHitstopEnded;
|
||||
}
|
||||
|
||||
public void OnHitstopEnded()
|
||||
{
|
||||
ResetTimeScale();
|
||||
}
|
||||
public void ReduceHealth(IDamageable source, DamageRecord damageRecord)
|
||||
{
|
||||
CHealth.ReduceHealth(source, damageRecord);
|
||||
HealthChanged?.Invoke(this, CHealth.CurrentHealth);
|
||||
}
|
||||
public void RegisterKnockback(IDamageable source, DamageRecord damageRecord)
|
||||
{
|
||||
CKnockback.RegisterKnockback(source, damageRecord);
|
||||
}
|
||||
|
||||
public Vector3 ComputeKnockback()
|
||||
{
|
||||
return CKnockback.ComputeKnockback();
|
||||
}
|
||||
|
||||
public void Kill(IHealthable source)
|
||||
{
|
||||
GD.Print("Player died!");
|
||||
}
|
||||
|
||||
public void ResetInvincibility()
|
||||
{
|
||||
_isInvincible = false;
|
||||
}
|
||||
}
|
||||
|
||||
7
player_controller/resources/player_health.tres
Normal file
7
player_controller/resources/player_health.tres
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_resource type="Resource" script_class="RHealth" load_steps=2 format=3 uid="uid://bjyd801wvverk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://baiapod3csndf" path="res://components/health/RHealth.cs" id="1_tv6ah"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_tv6ah")
|
||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
||||
8
player_controller/resources/player_knockback.tres
Normal file
8
player_controller/resources/player_knockback.tres
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="RKnockback" load_steps=2 format=3 uid="uid://bs8b0oojixm4q"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://components/knockback/RKnockback.cs" id="1_dthjm"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_dthjm")
|
||||
Modifier = 30.0
|
||||
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||
@@ -0,0 +1,7 @@
|
||||
[gd_resource type="Resource" script_class="RDamageModifier" load_steps=2 format=3 uid="uid://dyru7mxo121w6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6y3ugfydvch0" path="res://components/damage/RDamageModifier.cs" id="1_7i47t"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_7i47t")
|
||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
||||
@@ -73,7 +73,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
public void SetupSignals()
|
||||
{
|
||||
_damageBox.BodyEntered += OnDamageBoxTriggered;
|
||||
if (CDamage is IDamageable damageable)
|
||||
{
|
||||
damageable.DamageTaken += ReduceHealth;
|
||||
@@ -84,6 +83,9 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
// Only trigger gameplay related effects 4 times per second
|
||||
if(Engine.GetPhysicsFrames() % 15 == 0) ProcessGameplay(delta);
|
||||
|
||||
var targetPlanar = new Vector3(Target.GlobalPosition.X, GlobalPosition.Y, Target.GlobalPosition.Z);
|
||||
LookAt(targetPlanar);
|
||||
|
||||
@@ -98,6 +100,16 @@ public partial class Enemy : CharacterBody3D,
|
||||
Velocity += ComputeKnockback();
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
public void ProcessGameplay(double delta)
|
||||
{
|
||||
var bodies = _damageBox.GetOverlappingBodies();
|
||||
foreach (var body in bodies)
|
||||
{
|
||||
if(body is IDamageable spawnable)
|
||||
spawnable.TakeDamage(new DamageRecord(this, RDamage));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 ComputeVelocity(MovementInputs inputs)
|
||||
{
|
||||
@@ -105,14 +117,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
return movement!.ComputeVelocity(inputs);
|
||||
}
|
||||
|
||||
public void OnDamageBoxTriggered(Node3D body)
|
||||
{
|
||||
if (body is not IDamageable damageable) return;
|
||||
|
||||
var damageRecord = new DamageRecord(this, RDamage);
|
||||
damageable.TakeDamage(damageRecord);
|
||||
}
|
||||
|
||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
if (CDamage is not IDamageable damageable)
|
||||
@@ -120,8 +124,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
var finalDamage = damageable.TakeDamage(damageRecord);
|
||||
DamageTaken?.Invoke(this, finalDamage);
|
||||
|
||||
GD.Print($"Received damage: {finalDamage.Damage.DamageDealt}");
|
||||
return finalDamage;
|
||||
}
|
||||
|
||||
@@ -129,6 +131,7 @@ public partial class Enemy : CharacterBody3D,
|
||||
{
|
||||
if (CHealth is not IHealthable healthable) return;
|
||||
healthable.ReduceHealth(source, damageRecord);
|
||||
HealthChanged?.Invoke(this, healthable.CurrentHealth);
|
||||
}
|
||||
|
||||
public void Kill(IHealthable source)
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_yq03x")
|
||||
Modifier = 10.0
|
||||
Modifier = 20.0
|
||||
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_vdia8")
|
||||
Modifier = 10.0
|
||||
Modifier = 30.0
|
||||
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||
|
||||
@@ -6,6 +6,11 @@ namespace Movementtests.systems;
|
||||
|
||||
public partial class HeadSystem : Node3D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void HitboxActivatedEventHandler();
|
||||
[Signal]
|
||||
public delegate void HitboxDeactivatedEventHandler();
|
||||
|
||||
public record CameraParameters(
|
||||
double Delta,
|
||||
Vector2 LookDir,
|
||||
@@ -21,6 +26,7 @@ public partial class HeadSystem : Node3D
|
||||
private Camera3D _camera;
|
||||
private Marker3D _cameraAnchor;
|
||||
private AnimationPlayer _animationPlayer;
|
||||
private AnimationTree _animationTree;
|
||||
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
public float LookSensitivity { get; set; } = 1f;
|
||||
@@ -63,7 +69,8 @@ public partial class HeadSystem : Node3D
|
||||
|
||||
[ExportGroup("First Person rig")]
|
||||
private Node3D _fpRig;
|
||||
private Vector3 _fpRigInitialPosition;
|
||||
private Node3D _fpDisplacedRig;
|
||||
private Vector3 _fpDisplacedRigInitialRotation;
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
public float WeaponSway { get; set; } = 5f;
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
@@ -72,6 +79,14 @@ public partial class HeadSystem : Node3D
|
||||
public float WeaponMoveRotation { get; set; } = 80f;
|
||||
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
|
||||
public float WeaponAdjustmentSpeed { get; set; } = 10f;
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
public float DisplacedWeaponSway { get; set; } = 5f;
|
||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
||||
public float DisplacedWeaponLookRotation { get; set; } = 1f;
|
||||
[Export(PropertyHint.Range, "0,1,0.01,or_greater")]
|
||||
public float DisplacedWeaponMoveRotation { get; set; } = 0.1f;
|
||||
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
|
||||
public float DisplacedWeaponAdjustmentSpeed { get; set; } = 10f;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
@@ -79,9 +94,11 @@ public partial class HeadSystem : Node3D
|
||||
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
|
||||
_cameraAnchor = GetNode<Marker3D>("CameraAnchor");
|
||||
_animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer");
|
||||
_animationTree = GetNode<AnimationTree>("AnimationTree");
|
||||
|
||||
_fpRig = GetNode<Node3D>("FPRig");
|
||||
_fpRigInitialPosition = _fpRig.GlobalPosition;
|
||||
_fpDisplacedRig = GetNode<Node3D>("FPRig/Sword");
|
||||
_fpDisplacedRigInitialRotation = _fpDisplacedRig.Rotation;
|
||||
|
||||
_slidingNoise.NoiseType = FastNoiseLite.NoiseTypeEnum.Perlin;
|
||||
_slidingNoise.SetFrequency(SlidingJitterFrequency);
|
||||
@@ -91,6 +108,21 @@ public partial class HeadSystem : Node3D
|
||||
{
|
||||
_animationPlayer.Play("mantle");
|
||||
}
|
||||
|
||||
public void OnHit()
|
||||
{
|
||||
_animationTree.Set("parameters/OnHit/request", (int) AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
}
|
||||
|
||||
public void OnHitboxActivated()
|
||||
{
|
||||
EmitSignalHitboxActivated();
|
||||
}
|
||||
|
||||
public void OnHitboxDeactivated()
|
||||
{
|
||||
EmitSignalHitboxDeactivated();
|
||||
}
|
||||
|
||||
public void LookAround(CameraParameters inputs)
|
||||
{
|
||||
@@ -167,16 +199,41 @@ public partial class HeadSystem : Node3D
|
||||
_fpRig.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
|
||||
// Apply bobbing
|
||||
_fpRig.Position += newPositionForRig;
|
||||
|
||||
|
||||
// Rotate the whole rig based on movement input
|
||||
var newRigRotation = _fpRig.Rotation;
|
||||
var camTilt = Mathf.Lerp(_fpRig.Rotation.Z, cameraIncline*WeaponMoveRotation, delta*WeaponAdjustmentSpeed);
|
||||
newRigRotation.Z = (float) camTilt;
|
||||
|
||||
// var lookInputLerped = lookDir.Lerp(Vector2.Zero, (float) delta * WeaponAdjustmentSpeed);
|
||||
// Rotate the whole rig based on camera rotation input
|
||||
newRigRotation.X = Mathf.Lerp(newRigRotation.X, -lookDir.Y*WeaponSway, (float) delta*WeaponAdjustmentSpeed);
|
||||
newRigRotation.Y = Mathf.Lerp(newRigRotation.Y, -lookDir.X*WeaponSway, (float) delta*WeaponAdjustmentSpeed);
|
||||
|
||||
// Apply
|
||||
_fpRig.Rotation = newRigRotation;
|
||||
|
||||
// Compute displaced rig adjustments, starting with movement input
|
||||
var newDisplacedRigRotation = _fpDisplacedRig.Rotation;
|
||||
|
||||
var howMuchForward = ComputeHowMuchInputForward(playerInput);
|
||||
var howMuchSideways = ComputeHowMuchInputSideways(playerInput);
|
||||
var displacedCamTiltForward = Mathf.Lerp(newDisplacedRigRotation.Z,
|
||||
_fpDisplacedRigInitialRotation.Z + howMuchForward*DisplacedWeaponMoveRotation,
|
||||
delta*DisplacedWeaponAdjustmentSpeed);
|
||||
var displacedCamTiltSide = Mathf.Lerp(newDisplacedRigRotation.X,
|
||||
_fpDisplacedRigInitialRotation.X - howMuchSideways*DisplacedWeaponMoveRotation,
|
||||
delta*DisplacedWeaponAdjustmentSpeed);
|
||||
|
||||
newDisplacedRigRotation.X = (float) displacedCamTiltSide;
|
||||
newDisplacedRigRotation.Z = (float) displacedCamTiltForward;
|
||||
|
||||
var displacedSwayY = Mathf.Lerp(newDisplacedRigRotation.Y,
|
||||
_fpDisplacedRigInitialRotation.Y - lookDir.X*DisplacedWeaponSway,
|
||||
delta*DisplacedWeaponAdjustmentSpeed);
|
||||
newDisplacedRigRotation.Y = (float) displacedSwayY;
|
||||
|
||||
// Apply
|
||||
_fpDisplacedRig.Rotation = newDisplacedRigRotation;
|
||||
|
||||
// Camera adjustments
|
||||
float velocityClamped = Mathf.Clamp(playerVelocity.Length(), 0.5f, FovMaxedOutSpeed);
|
||||
@@ -200,6 +257,20 @@ public partial class HeadSystem : Node3D
|
||||
return crossProduct.Length()*Mathf.Sign(crossProduct.Y);
|
||||
}
|
||||
|
||||
public float ComputeHowMuchInputForward(Vector3 playerInput)
|
||||
{
|
||||
var forwardAngle = GetForwardHorizontalVector().AngleTo(playerInput);
|
||||
var forwardRemapped = Mathf.Remap(forwardAngle, 0, Mathf.Pi, -1, 1);
|
||||
return playerInput.Length() > 0 ? forwardRemapped : 0;
|
||||
}
|
||||
|
||||
public float ComputeHowMuchInputSideways(Vector3 playerInput)
|
||||
{
|
||||
var rightAngle = GetForwardHorizontalVector().Cross(Vector3.Up).Normalized().AngleTo(playerInput);
|
||||
var forwardRemapped = Mathf.Remap(rightAngle, 0, Mathf.Pi, -1, 1);
|
||||
return playerInput.Length() > 0 ? forwardRemapped : 0;
|
||||
}
|
||||
|
||||
public Vector3 GetForwardHorizontalVector()
|
||||
{
|
||||
return GetGlobalTransform().Basis.Z;
|
||||
|
||||
24
systems/head/fp_blend_tree.tres
Normal file
24
systems/head/fp_blend_tree.tres
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_resource type="AnimationNodeBlendTree" load_steps=5 format=3 uid="uid://c26yvcyyyj811"]
|
||||
|
||||
[ext_resource type="AnimationNodeStateMachine" uid="uid://3r5oeg0ho0d4" path="res://systems/head/fp_state_machine.tres" id="1_knaxl"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_knaxl"]
|
||||
animation = &"idle"
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_1hkum"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_23rmc"]
|
||||
animation = &"hit1"
|
||||
|
||||
[resource]
|
||||
graph_offset = Vector2(-455.3856, -37.41575)
|
||||
nodes/output/position = Vector2(320, 160)
|
||||
nodes/AnimationNodeStateMachine/node = ExtResource("1_knaxl")
|
||||
nodes/AnimationNodeStateMachine/position = Vector2(-540, 200)
|
||||
nodes/Idle/node = SubResource("AnimationNodeAnimation_knaxl")
|
||||
nodes/Idle/position = Vector2(-80, 20)
|
||||
nodes/OnHit/node = SubResource("AnimationNodeOneShot_1hkum")
|
||||
nodes/OnHit/position = Vector2(120, 100)
|
||||
nodes/hit1/node = SubResource("AnimationNodeAnimation_23rmc")
|
||||
nodes/hit1/position = Vector2(-80, 220)
|
||||
node_connections = [&"output", 0, &"OnHit", &"OnHit", 0, &"Idle", &"OnHit", 1, &"hit1"]
|
||||
28
systems/head/fp_state_machine.tres
Normal file
28
systems/head/fp_state_machine.tres
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_resource type="AnimationNodeStateMachine" load_steps=6 format=3 uid="uid://3r5oeg0ho0d4"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_adm0b"]
|
||||
animation = &"hit1"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_73q32"]
|
||||
animation = &"idle"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_adm0b"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7r4t3"]
|
||||
advance_mode = 2
|
||||
advance_condition = &"on_hit"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2u8w7"]
|
||||
break_loop_at_end = true
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[resource]
|
||||
states/Start/position = Vector2(100, 91)
|
||||
states/hit1/node = SubResource("AnimationNodeAnimation_adm0b")
|
||||
states/hit1/position = Vector2(511, 61)
|
||||
states/idle/node = SubResource("AnimationNodeAnimation_73q32")
|
||||
states/idle/position = Vector2(331, 91)
|
||||
transitions = ["Start", "idle", SubResource("AnimationNodeStateMachineTransition_adm0b"), "idle", "hit1", SubResource("AnimationNodeStateMachineTransition_7r4t3"), "hit1", "idle", SubResource("AnimationNodeStateMachineTransition_2u8w7")]
|
||||
graph_offset = Vector2(-82, -9)
|
||||
@@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://0ysqmqphq6mq"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://0ysqmqphq6mq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://ckr26s4e3fj1m" path="res://assets/swords/resources/fp_sword23.tres" id="2_c5qep"]
|
||||
[ext_resource type="AnimationNodeBlendTree" uid="uid://c26yvcyyyj811" path="res://systems/head/fp_blend_tree.tres" id="3_r0h40"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_urko7"]
|
||||
length = 0.001
|
||||
@@ -27,6 +28,54 @@ tracks/1/keys = {
|
||||
"points": PackedFloat32Array(0, -0.15, 0, 0.15, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("../../FPRig/Sword:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0.53640664, -0.7880347, -1.9288678)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("../../FPRig/Sword:rotation")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.083978735, -1.136043, 0.19867715)]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../../FPRig/Sword:scale")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(1.0000001, 1.0000001, 1.0000005)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("..:rotation")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0.00011616433)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8abgy"]
|
||||
resource_name = "mantle"
|
||||
@@ -54,25 +103,131 @@ tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_0hyrq"]
|
||||
resource_name = "idle"
|
||||
length = 2.0
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("../../FPRig/Sword:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6, 1, 1.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0.53640664, -0.7880347, -1.9288678), Vector3(0.53640664, -0.83580256, -1.9288678), Vector3(0.53640664, -0.86088884, -1.9288678), Vector3(0.53640664, -0.8256072, -1.9288678), Vector3(0.53640664, -0.7880347, -1.9288678)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("../../FPRig/Sword:rotation")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6, 1, 1.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.083978735, -1.136043, 0.19867715), Vector3(-0.06987281, -1.1365474, 0.20524277), Vector3(-0.05990464, -1.1368362, 0.20987195), Vector3(-0.06303402, -1.1367121, 0.2084137), Vector3(-0.083978735, -1.136043, 0.19867715)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r0h40"]
|
||||
resource_name = "hit1"
|
||||
length = 0.30000168
|
||||
step = 0.016666668
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("../../FPRig/Sword:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.06666667, 0.11666667, 0.15, 0.21666667, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0.53640664, -0.7880347, -1.9288678), Vector3(0.4045868, -0.4412415, -1.5352597), Vector3(-0.4799922, -0.5403832, -1.6861614), Vector3(-0.46995986, -0.53766656, -1.3638693), Vector3(-0.49520528, -0.5369735, -1.3145388), Vector3(-0.4048354, -0.5878634, -1.2836416)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("../../FPRig/Sword:rotation")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.06666667, 0.11666667, 0.15, 0.21666667, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.083978735, -1.136043, 0.19867715), Vector3(-0.7788485, -2.0049822, -0.2951485), Vector3(-0.94931036, -0.5881021, -0.61733377), Vector3(-1.3252386, -0.102411434, 0.58406436), Vector3(-1.2938086, -0.18945412, 0.7334958), Vector3(-1.1484056, -0.2900904, 0.6867544)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("../../FPRig/Sword:scale")
|
||||
tracks/2/interp = 2
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.06666667, 0.11666667, 0.15, 0.21666667, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(1.0000001, 1.0000001, 1.0000005), Vector3(1, 1.0004268, 1.0000002), Vector3(0.99999994, 1.2493719, 0.99999976), Vector3(1.0000001, 1.1750004, 1.0000004), Vector3(0.99999994, 0.99999994, 0.99999994), Vector3(1.0000001, 0.9999999, 1)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("..:rotation")
|
||||
tracks/3/interp = 2
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0, 0.083333336, 0.11666667, 0.2, 0.23333333, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, 0, 0), Vector3(0, 0, 0.00011616433), Vector3(0, -0.02617994, -0.02617994), Vector3(0, 0.02617994, 0.02617994), Vector3(0, 0, 0)]
|
||||
}
|
||||
tracks/4/type = "method"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../..")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(0.083333336, 0.23333333),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"OnHitboxActivated"
|
||||
}, {
|
||||
"args": [],
|
||||
"method": &"OnHitboxDeactivated"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0hyrq"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_urko7"),
|
||||
&"hit1": SubResource("Animation_r0h40"),
|
||||
&"idle": SubResource("Animation_0hyrq"),
|
||||
&"mantle": SubResource("Animation_8abgy")
|
||||
}
|
||||
|
||||
[node name="HeadSystem" type="Node3D"]
|
||||
script = ExtResource("1_8abgy")
|
||||
WeaponMoveRotation = 20.0
|
||||
DisplacedWeaponSway = 1.0
|
||||
DisplacedWeaponAdjustmentSpeed = 8.0
|
||||
|
||||
[node name="FPRig" type="Node3D" parent="."]
|
||||
|
||||
[node name="Sword" type="Node3D" parent="FPRig"]
|
||||
transform = Transform3D(0.42791694, -0.008550272, -0.9037781, 0.19667713, 0.9768738, 0.0838801, 0.88215953, -0.2136461, 0.41970265, 0.53640664, -0.7880347, -1.9288678)
|
||||
|
||||
[node name="SwordMesh" type="MeshInstance3D" parent="FPRig/Sword"]
|
||||
transform = Transform3D(0.43494374, 0.027831191, -0.9000275, 0.1806065, 0.9765146, 0.117475554, 0.8821594, -0.2136461, 0.41970232, 0.53640664, -0.82246387, -1.9288678)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.99999994, 0, 0, 0, 1, 0, 0, 0)
|
||||
cast_shadow = 0
|
||||
mesh = ExtResource("2_c5qep")
|
||||
|
||||
[node name="CameraSmooth" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, -0.00011616433, 0, 0.00011616433, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraSmooth"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.99999994, 0, 0, 0, 0.99999994, 0, 0, 0)
|
||||
@@ -86,3 +241,12 @@ root_node = NodePath("../CameraSmooth/Camera3D")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_0hyrq")
|
||||
}
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
root_node = NodePath("../CameraSmooth/Camera3D")
|
||||
tree_root = ExtResource("3_r0h40")
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/AnimationNodeStateMachine/conditions/on_hit = false
|
||||
parameters/OnHit/active = false
|
||||
parameters/OnHit/internal_active = false
|
||||
parameters/OnHit/request = 0
|
||||
|
||||
Reference in New Issue
Block a user