Hello i face a realy wired problem. I try to emit an signal when my player is shoting
public override void _Process(double delta)
{
base._Process(delta);
if(_enabled)
{
RotateCamera((float)delta);
}
var viewmodelNode = _viewmodel.GetNode<Node3D>("weapon_1");
if (viewmodelNode != null)
{
var weaponScript = viewmodelNode as WeaponScript;
var animationPlayer = viewmodelNode.GetNode<AnimationPlayer>("AnimationPlayer");
if (Input.IsActionPressed("attack") && _enabled)
{
if(_lockAnimation == false && weaponScript.CanShoot())
{
EmitSignal("PerformShotEventHandler");
weaponScript.PerformShot(GetViewport().GetCamera3D());
State = CharacterState.Attacking;
}
}
if (Input.IsActionJustPressed("reload") && _enabled)
{
weaponScript.StartReload();
State = CharacterState.Reloading;
}
switch (State)
{
case CharacterState.Idle:
this.PlayAnimation(animationPlayer, weaponScript.AnimationIdle, weaponScript.AnimationIdleSpeed);
break;
case CharacterState.Walking:
this.PlayAnimation(animationPlayer, weaponScript.AnimationWalk, weaponScript.AnimationWalkSpeed);
break;
case CharacterState.Running:
this.PlayAnimation(animationPlayer, weaponScript.AnimationRun, weaponScript.AnimationRunSpeed);
break;
case CharacterState.Inspecting:
this.PlayAnimation(animationPlayer, weaponScript.AnimationInspect, weaponScript.AnimationInspectSpeed);
break;
case CharacterState.Attacking:
this.PlayAnimation(animationPlayer, weaponScript.AnimationAttack, weaponScript.AnimationAttackSpeed, true);
break;
case CharacterState.Reloading:
this.PlayAnimation(animationPlayer, weaponScript.AnimationReload, weaponScript.AnimationReloadSpeed, true);
break;
default:
this.PlayAnimation(animationPlayer, weaponScript.AnimationIdle, weaponScript.AnimationIdleSpeed);
break;
}
var camera = _head.GetNode<Camera3D>("Camera3D");
if(camera != null)
{
this.HandleInteraction(camera);
}
}
}
But however i recive this error message
E 0:00:05:801 NativeCalls.cs:7404 @ int Godot.NativeCalls.godot_icall_2_838(nint, nint, Godot.NativeInterop.godot_string_name, System.ReadOnlySpan`1[Godot.Variant], Godot.NativeInterop.godot_string_name): Can't emit non-existing signal "PerformShotEventHandler".
But the signal exist i even connected it in the editor.