diff --git a/player_controller/PlayerController.tscn b/player_controller/PlayerController.tscn index b8bfaa98..0db82c24 100644 --- a/player_controller/PlayerController.tscn +++ b/player_controller/PlayerController.tscn @@ -276,7 +276,9 @@ PostDashSpeed = 30.0 [node name="WeaponSystem" parent="WeaponRoot" instance=ExtResource("29_wv70j")] transform = Transform3D(1, 0, 0, 0, 0.173648, -0.984808, 0, 0.984808, 0.173648, 0.45268, 1.44035, -0.692528) -ThrowForce = 15.0 +mass = 10.0 +gravity_scale = 3.0 +ThrowForce = 300.0 StraightThrowDuration = 0.05 [node name="DashIndicator" type="Node3D" parent="."] diff --git a/systems/weapon/WeaponSystem.cs b/systems/weapon/WeaponSystem.cs index 3ff35360..904abd37 100644 --- a/systems/weapon/WeaponSystem.cs +++ b/systems/weapon/WeaponSystem.cs @@ -70,6 +70,7 @@ public partial class WeaponSystem : RigidBody3D public void WeaponLeft() { + Visible = true; WeaponLocationIndicator.Visible = true; WeaponMaterial!.UseFovOverride = false; EmitSignalWeaponThrown(); @@ -77,6 +78,7 @@ public partial class WeaponSystem : RigidBody3D public void WeaponBack() { + Visible = false; WeaponLocationIndicator.Visible = false; WeaponMaterial!.UseFovOverride = true; EmitSignalWeaponRetrieved(); @@ -88,7 +90,6 @@ public partial class WeaponSystem : RigidBody3D Freeze = true; GlobalPosition = location; PlantLocation = location; - Visible = false; } public void ThrowWeapon(Vector3 end, bool hasHit, Vector3 collisionLocation, Vector3 collisionNormal) @@ -136,7 +137,7 @@ public partial class WeaponSystem : RigidBody3D _weaponState.SendEvent("recover"); Transform = _startTransform; Freeze = true; - Visible = true; + Visible = false; } public override void _IntegrateForces(PhysicsDirectBodyState3D state) @@ -150,6 +151,13 @@ public partial class WeaponSystem : RigidBody3D } } + public override void _PhysicsProcess(double _delta) + { + if (!FlyingState.Active) return; + + LookAt(GlobalTransform.Origin + LinearVelocity.Normalized(), Vector3.Up, false); + } + public bool IsPlantedUnderPlatform() { return PlantedState.Active && GlobalRotation.X > 1 && Math.Abs(GlobalRotation.Y) > 1;