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, 2019 in Engine by SergLoff (30 points)
edited May 17, 2019 by SergLoff

1 Answer

+1 vote
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, 2019 by SergLoff (30 points)

Any link from the reddit user you're mentioning or is it a private?

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.