#First 2D Game - Signal Connect not creating code in Player.cs or SignalName "Hit" value

1 messages · Page 1 of 1 (latest)

cobalt token
#

I am doing the the "Your First 2D game". I am on 4.1.1 Mono/C# version.

On part 3 of the tutorial it says to connect the signal "body_entered". It states that once you connect it, it should generate the method OnBodyEntered. This method is not generated. I tried building the project. Restarting both the Godot editor and VSCode.

Additionally, the sample code says to add a line to the OnBodyEntered method. The line "EmitSignal(SignalName.Hit);" is throwing an error. It seems that the name Hit was not added to the SignalName object despite it showing in the editor.

In the editor I manually added the OnBodyEntered() connection after the default _on_body_entered() generated nothing.

Is this a version issue, or a simple mistake, or something else I'm not seeing?

forest cave
#

The signal must be named HitEventHandler. A little magic that relies on naming 😅

cobalt token
#

Unfortunately it has been. the "Hit()" was generated somewhere and is in the UI.

In fact, if you try to name it anything else, the code wont compile. Mine will, just not work