0 votes

Hi

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 (227 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,692 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 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.