-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get id of type by instance is impossible #82519
Comments
I found one solution.
So, I can indexing my config by GDScript or |
See also:
Godot has a three-level type system:
There are also typed arrays (they have In GDScript you can use the
Will the issue be considered resolved? |
Yeah, I tryed different variants.
I dont know. May be someone find more clear method for my task. |
Godot version
4.1.1.stable
System information
Windows 10, GLES2, Intel(R) UHD Graphics 630
Issue description
I have class A
I have instance
I have some configuring for types
So I can get config for A
var conf = dict[A]
But I can't get config for instance
var conf = dict[a]
I understand that 'a' and 'A' are diferent objects, but in C# I can do this
Then I can fill dict by typeof(A), typeof(MyOtherClass) etc...
After it I can get conf by
var conf = dict[a.GetType()]
I can't do it in GDScript
I don't want add in my classes func
What can I do outside class script to get what I want (get A from a)?
Steps to reproduce
Nothing
Minimal reproduction project
Nothing
The text was updated successfully, but these errors were encountered: