0 votes

Can i do everything in C++ or can everything that can be made with GDScript be made with GDNative C++ or i must code some things from scratch ?

Godot version 3.22
in Engine by (28 points)

1 Answer

+1 vote
Best answer

More than 99% can be done in C++(GDNative).
So far, its only in the editor's inspector where I haven't quite figured out how to do everything from GDNative, like:
-propertylistchanged_notify() not updating values in inspector as it does in GDScript,
-exposing a variable as a specific type like Texture; I use Variant then cast it instead.

Also, you may need to use the STL for things like vector if not create your own since Godot's Vector class is not exposed in GDNative.

by (64 points)
selected by

What frustrates me is that in C# and GDScript when a node extends from KinematicBody 2D for example there is 2 properties called Position And Rotation ( Vector and float ) storing the body's position and rotation and i can't find this anywhere in GDNative. So how come that something so basic is not exposed ?

// In GDNative, accessor functions typically have get_ or set_
// prepended, so those should already be exposed as:
Vector2 pos = get_position();
float rot = get_rotation_degrees();
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.