+1 vote

I'm new to Godot, so the issue here is probably that I don't understand an element of how things work, but I would appreciate any help/explanations.

My understanding is (based on the docs and various tutorials) if you're working in GDScript, when you attach a script to a node you can inherit from either a standard node type (e.g. Node2D, KinematicBody2D etc.) or from an existing script attached to a specific node instance (e.g. World).

My issue is, I don't seem to be able to do the latter in C#. In the Godot GUI, when I go to 'Attach Node Script' the button is greyed out when you choose C# from the dropdown.
enter image description here
If I enter a path to the C# script in the 'Inherits' box, it tells me that this is an invalid parent name or path (even when the script (in the example case 'World.cs') definitely exists).
enter image description here
I can create a script that inherits from, for instance, "Node2D" and then overwrite the inheritance relationship in the script:

public class myNode : World

but this doesn't seem to behave correctly at runtime (I suspect because the engine isn't aware of the inheritance relationship).

Is this intentional/a limitation/an intended feature? Is there another way to do this with C# in Godot that I'm missing? Is there something key that I'm misunderstanding? If anyone can help out it would be much appreciated.

Godot version v3.2.3.stable.mono
in Engine by (13 points)

I have the same problem :/

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.