using Godot; using System.Linq; public partial class MegamiBeamShot : Projectile { [Export] private PathFollow3D _pathFollow; [Export] public new AudioStream _soundEffect; public override void _Ready() { _pathFollow = GetNode("Path3D/PathFollow3D"); _pathFollow.GetParentNode3D().Rotation = ParentCharacter.GetNode("Pivot").Rotation; var sfxPlayer = GetTree().Root.GetNode("Main/SFXPlayer"); sfxPlayer.Stream = _soundEffect; sfxPlayer.Play(); } public override void _PhysicsProcess(double delta) { _pathFollow.Progress += 10f * (float)delta; if (Mathf.IsEqualApprox(_pathFollow.ProgressRatio, 1.0f)) QueueFree(); } private void OnBulletHitObject(Node node) { QueueFree(); } }