0 votes

I am trying to replicate This Singleton Example using c++ with GDNative, but i haven't been able to find out how to do this part

var s = ResourceLoader.load(path)

# Instance the new scene.
current_scene = s.instance()

# Add it to the active scene, as child of root.

Any help would be greatly appreciated.
Thank you.

asked May 14 in Engine by SergLoff (28 points)
edited May 17 by SergLoff

1 Answer

0 votes
Best answer

A reddit user gave me the solution so in case somebody ever needs it I'm going to post it here.

ResourceLoader* reLo = ResourceLoader::get_singleton();
Ref<PackedScene> res = reLo->load(path);
CurrentScene = res->instance();



answered May 17 by SergLoff (28 points)
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 How to use this Q&A? before posting your first questions.