orienting flying sword
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user