Skip to content

How to instantiate custom class via GDNative (Question) #253

@xDGameStudios

Description

@xDGameStudios

What is the correct way to instantiate a custom class and return it to Godot via GDNative?!

(minimal representation below)

class A : public Reference {
     Ref<B> create_b()
}

class B : public Reference {
}

what should be the body of create_b() ?
for future reference the correct way to do this is:

return Ref<B>::__internal_constructor(B::_new()) ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions