godotengine / godotengine/godot-cpp

not able to pass arguments to object during construction

Open
#953 10 comments 12 reactions 0 assignees View on GitHub
discussion
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

Unless I'm mistaken, it appears to not be possible to pass arguments to a constructor (new/_init) from gdscript.

one would think you could bind _init and pass arguments to new() from GDscript but that does not seem to be the case.

This is kind of a big deal since it breaks RAII which is one of the most fundamental features of C++. Having to call a function after a class is built, or it is malformed, is not good.

If this is currently possible, it should be added to the example as it will be used by nearly everyone who uses c++.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.