This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes


I have create extension of Position3D class with my custom name, it looks like this:

extends Position3D

class_name CrossControl

But when I'm asking for the class using get_class() function it's still returning me original name (Position3D).

How to create a new class that returns its name correctly?

For now I'm just overriding get_class() function but I'm not sure that it's correct way?

in Engine by (228 points)

1 Answer

0 votes
Best answer

I don't know why Dlean Jeans didn't post his link as answer, because this Github issue sums up the whole discussion nicely:

Yes, overriding get_class() is currently the best way to do it, but this issue is being discussed already and might lead to a changed behaviour of get_class in the future.

by (1,762 points)
selected by
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 Frequently asked questions and 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 [email protected] with your username.