I need help with Signals (and camera control)

Godot Version

4.0

Question

So, what I thought would be a 4-second implementation has now had me stumped for about 2 hours; I’m trying to implement a delay between the space bar being pressed, and the jump. I’ve looked at every resource on timers that I can find, but for some reason, one problem keeps cropping up every time I try; it says that ‘OnDelayFin’ (or whatever else I set the _on_timer_timeout method name to) is not found in the current context.

I read the documentation, and originally the problem was because I was using outdated sources and didn’t know about the ‘callable’ change; but now I don’t know what it is, I called GetNode() and I did the += OnDelayFin thing (both with parentheses and without), I also tried using the Node API to connect, and while I have access to the timer, I don’t have access to the signal? I’ve disconnected and reconnected a dozen times and I really don’t know what could be causing the issue.

using Godot;
using System;
using System.Security.Cryptography.X509Certificates;

public partial class player : CharacterBody3D
{
	public const float Speed = 8f;
	public const float JumpVelocity = 8f;

	// Get the gravity from the project settings to be synced with RigidBody nodes.
	public float gravity = ProjectSettings.GetSetting("physics/3d/default_gravity").AsSingle();

	private Timer delay;
    public override void _Ready()
    {
        delay = GetNode<Timer>("jumpDelay");
		delay.Timeout += OnDelayFin;
    }
    public override void _PhysicsProcess(double delta)
	{
		Vector3 velocity = Velocity;

		// Add the gravity.
		if (!IsOnFloor())
		{
			velocity.Y -= gravity * (float)delta;
		}

		// Handle Jump.
		if (Input.IsActionJustPressed("jump") && IsOnFloor())
		{
			delay.Start(0.4f);
			
        }

		// Get the input direction and handle the movement/deceleration.
		// As good practice, you should replace UI actions with custom gameplay actions.
		Vector2 inputDir = Input.GetVector("left", "right", "forward", "back");
		Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
		if (direction != Vector3.Zero)
		{
			velocity.X = direction.X * Speed;
			velocity.Z = direction.Z * Speed;
		}
		else
		{
			velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed);
			velocity.Z = Mathf.MoveToward(Velocity.Z, 0, Speed);
		}

		Velocity = velocity;
		MoveAndSlide();

Also, on another note, I still don’t completely understand camera control; I want to implement a ‘souls-like camera,’ where the player can move around in the camera’s FoV, but the camera still follows the player when they move further. Though that’s less important than this other thing; I want to make the camera focus, like how in Final Fantasy Dissidia, you lock on, and the camera goes over-the-shoulder to look at the player, while also focusing on the opponent, and making movement and such relative to that, rather than relative to the default Camera Forward direction.

I have no idea if any of that made sense, but the first question is the only pressing one. I’m making a 1v1/2v2 3d Arena Fighter, by the way, in the same vein as Dissidia and Ultimate Ninja Storm, but with more focus on movement and spacing. The movement is difficult, but I at least know where to start, hence why all my questions are about the camera, which I have no damn clue how to control and all the resources I can find are in GDScript (and only really tell you how to capture input).

Anyway, thanks for coming to my tedtalk, I can’t wait to find out that I’ve just been missing a semicolon or something.

I am sorry but where does OnDelayFin originate?
I don’t know much of C/C# for Godot but still, I cannot recognize this one.

Do you have source?

ope-
sorry, OnDelayFin = _on_timer_timeout, my bad. I just used the godot api to change the method name

Don’t know C# syntax with Godot, but here’s how I’d debug it:

  1. make sure you actually start the timer somewhere lol, sometimes it’s the obvious thing…
  2. print node value after GetNode to make sure you get the object.
  3. call is_connected (w/e the c# version) after connecting to make sure connecting worked.

If timer is real object, you’re connected, and you start the timer, it should always do the callback unless the parent object timer is connected to is queue_free-d before then.

ps: C# capitalization is giving me a headache haha, gosh am I glad for gdscript