(C#) Unable to register custom HttpRequest node as a GlobalClass

Godot Version

4.5 Stable

Question

Hello!

When I add the [GlobalClass] attribute to a class that inherits from the HttpRequest node, I haven’t been able to find it in the “Create New Node” dialog window. I haven’t been able to reproduce this issue with any other class (Tested with Node, Node3D, Rigidbody3D, Control). I tried enforcing the Godot namespace by prefixing “Godot.” to HttpRequest. I’ve triple-checked my file naming and even tried different file names in case of something weird there. I am clicking the build button in Godot after each file change. Unsure if it happens with any other class types yet.

using Godot;
using System;

[GlobalClass]
public partial class HttpRequestModified : Godot.HttpRequest
{
	
}

Repro Steps:

  1. New Project (.net)
  2. Create new C# Script via the Godot FileSystem New Script dialog, choosing “HttpRequest” as the inheriting class
  3. Append [GlobalClass] attribute before public partial class etc
  4. Save file
  5. Build Project via Godot Engine
  6. Open the Add New Node dialog by attempting to add a new node to the scene tree
  7. Search by class name (i.e. HttpRequestModified)
  8. Notice your modified HttpRequest does not appear in the new node tree as an option.

I could be wrong but this might be intentional, since HttpRequest uses the HttpClient internally, and I think the engine is doing some behind the scenes magic with it to re-use connections and such.

Hmm, I don’t know how different using [GlobalClass] in C# vs class_name <name> in GDScript is (which currently works for HttpRequest). I suppose it’s possible there’s some sort of blocker in the C# implementation for it to not work there.