-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
[NativeScript 1.1] Crash attempting to get physics inside of a local resource #175
Comments
This is unrelated, but instead of
to increase the protection maybe:
|
I think it might be a problem with classes not being added to the typemap properly? The error is in Godot in a HashMap lookup. |
I've also stumbled upon this problem, it used to work fine on nativescript-1.0 for me with this code: |
I'll have to retest this, might have been fixed upstream :) |
Could this be linked to a crash I'm experiencing when trying to bind _integrate_forces() in a GDNative script inheriting from RigidBody?
|
Any updates on this? This seem to still be an issue, I saw some updates on the related Godot issue godotengine/godot#17401 |
I seem to get this also. It crashes at HashMap::get function because it could not get the correct name for a class. I rigged so that it prints the names of the classes with a warning. This is my debug log:
and as you can see Physics2DDirectSpaceState has the name Physics2DDirectSpaceStateSW but in the generated __register_types.cpp it registers with: So is this a compiler quirk? I think it works fine on my linux machine (if i remember correctly). |
no there seems to exist a SW implementation of physics. SoftWare or server implementation? |
So I added godot::_TagDB::register_global_type("Physics2DDirectSpaceStateSW", typeid(Physics2DDirectSpaceState).hash_code(), typeid(Object).hash_code()); to __register_types.cpp and my project does not crash anymore though I do not think this is an acceptable solution in the long run? |
Yea so when I call get_direct_space_state it puts the implementation of Physics2DDirectSpaceState which in my case is Physics2DDirectSpaceStateSW in a godot::Object. So when nativescript tries to get binding data it tries to get it from Physics2DDirectSpaceStateSW instead of Physics2DDirectSpaceState. Though I do not know why it needs to call godot_nativescript_get_instance_binding_data on the data when it already has the data?
|
I ran into the same issue and after some investigation and some help from @karroffel I discovered the following: Strictly speaking this is not a binding issue, but an engine issue, as it breaks as follows:
The only safe solution seems to be to:
After that the C++ bindings should just work. |
Created PR godotengine/godot#27936 to fix this. |
I'm probably stretching the possibilities of time and space here but I'm trying to get access to the physics engine inside of a resource.
So I have the following code:
Which seems to crash on that final get_direct_space_state() call:
Not sure why...
The text was updated successfully, but these errors were encountered: