Skip to content
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

Add option to add_class at init time level #678

Open
Ughuuu opened this issue Apr 26, 2024 · 1 comment
Open

Add option to add_class at init time level #678

Ughuuu opened this issue Apr 26, 2024 · 1 comment
Labels
bug c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library

Comments

@Ughuuu
Copy link

Ughuuu commented Apr 26, 2024

I want to register a PhysicsServer at InitLevel::Servers, and in order to do so, I need to do:

pub fn register() {
    let mut manager = PhysicsServer2DManager::singleton();
    let factory = RapierPhysicsServerFactory2D::new_alloc();
    manager.register_server("Rapier2D".into(), factory.callable("create_server"));
}

For this, I need to create a new node, eg. RapierPhysicsServerFactory2D that will create the server(as such is the API of the PhysicsServer2DManager). In order to do so at InitLevel::Servers level, I need to be able to register nodes before it.

@lilizoey lilizoey added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript bug labels Apr 26, 2024
@lilizoey
Copy link
Member

lilizoey commented Apr 26, 2024

This is actually a bug too, we set a lot of the classes to have init level = Scene. even things that shouldn't like the physics server and physics server extensions. editor classes have Editor as they should though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library
Projects
None yet
Development

No branches or pull requests

2 participants