Trouble Reporting node configuration warnings in c#

Godot Version

4.3

Question

Hi!

I’m struggling to get _GetConfigurationWarnings() and UpdateConfigurationWarnings() working in a script of mine. There’s a GDScript example in the docs but I’m not sure how to get that working in c#.
Is this on the right track? With UpdateConfigurationWarnings to trigger the update?

    public override string[] _GetConfigurationWarnings()
    {
        GD.Print("Configuration warnings for - "+this.Name);
        string[] warnings = new string[] { };
        warnings.Append("Warning");
        return warnings;
        return base._GetConfigurationWarnings();
    }

Any help would be great,

Thanks,
Pete

Close, although I don’t know what the rest of the code is like or which bit you’re struggling with.

public override string[] _GetConfigurationWarnings()
{
    base._GetConfigurationWarnings();

    GD.Print("Configuration warnings for - "+this.Name);
    List<string> warnings = [];
    warnings.Add("Warning");

    return warnings.ToArray();
}
1 Like

Yay! that worked :partying_face:
Thanks!

1 Like