Changes in the connect() function inside a firing system

Godot Version

Godot v4.2.1

Hello and happy new year!
I’m pretty new to Godot, and as a first project I’m trying to make a simple top-down shooter. The biggest problem I’ve faced to this moment is trying to get the shooting system to work, as I want to have the bullets be added to another node as a child element instead of it being inside of the player’s CharacterBody2D node. I’ve seen people do it with signals, the “emit_signal()” function, and the connect() function on a script inside of the main scene node. The thing is that the sintax and usage of these functions have changed since when the examples were published, and the documentation only explains how to use those functions inside of the same game-element.
Could anyone help me understand how they work, applied to the concept I had? Otherwise, is there any other better way to do the shooting system?

The shooting system concept is based around this tutorial video:

Thank you very much in advance!!

The tutorial is based on Godot 3, and you’re using Godot 4.

I would suggest following the tutorial using Godot 3 (trying to replicate the steps and the logic).

If you still want to migrate to Godot 4 afterwards, I would suggest two options :

  1. the builtin migration tool (opening a Godot 3 project in Godot 4 will give you the option to migrate)
  2. looking into the official migration guide
1 Like