Godot 4.5
I’m trying to register a class using Godot’s C++ bindings, but I’m running into the issue where whenever I try to play I get the following errors
E 0:00:00:029 _register_extension_class_internal: Attempt to register an extension class 'PlayerController' using non-existing parent class 'CharacterBody3D'. <C++ Error> Method/function failed. <C++ Source> core/extension/gdextension.cpp:388 @ _register_extension_class_internal()
and
E 0:00:01:108 _instantiate_internal: Class 'PlayerController' can only be instantiated by editor. <C++ Source> core/object/class_db.cpp:556 @ _instantiate_internal()
my class header looks like this
#include <godot_cpp/classes/character_body3d.hpp>
#include <godot_cpp/classes/node3d.hpp>
#include "../../../header-only/export.h"
#pragma once
using namespace godot;
namespace player {
class PlayerController : public CharacterBody3D {
GDCLASS(PlayerController, CharacterBody3D)
public:
PlayerController();
void _physics_process(double p_delta) override;
~PlayerController();
private:
Vector3 get_direction(Vector2 input_vector);
void set_velocity_ground(Vector2 input_vector, Vector3 target_velocity, double delta);
protected:
static void _bind_methods();
};
}
it works just fine in editor, the issues seem to arise when I try to run the game