You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overriding _input, _unhandled_input, or _unhandled_key_input crashes and produces system error #655
In GDExtensions 4.0, trying to override any of the input functions produces an error when input is detected. Code compiles, project runs normally, and everything is copacetic until input is detected. The following error is produced prior to crashing.
terminate called after throwing an instance of 'std::system_error'
what(): Invalid argument
Looks like this might indicate a more general issue with overriding virtual functions in GDExtension classes - I ran into the same thing with _integrate_forces in #651. It might be worth merging these bug reports as this seems to be related or stemming from the same root cause.
A workaround is extending a GDExtension class with a GDSript. Overriding _input functions in GDScript and forwarding the events to another function in the GDExtension class that takes a variant seems to work.
Activity
nwroyer commentedon Nov 17, 2021
Looks like this might indicate a more general issue with overriding virtual functions in GDExtension classes - I ran into the same thing with
_integrate_forcesin #651. It might be worth merging these bug reports as this seems to be related or stemming from the same root cause.valentinAlkan commentedon Nov 19, 2021
A workaround is extending a GDExtension class with a GDSript. Overriding _input functions in GDScript and forwarding the events to another function in the GDExtension class that takes a variant seems to work.
GDExtensionBaseClassGD.gd
GDExtensionBaseClass.cpp
Faless commentedon Jul 28, 2022
Fixed by #677