0 votes

I have a QuestManager which stores quests (and their contained objectives) like so:

  • QuestManager

    • Quest

      • Objective 1
      • Objective 2
    • Quest

      • Objective 3

Each objective has a position (vec2) and a level name (e.g. "outside"). Objectives do not appear until previous objectives have been completed.

Objective 1 is located "outside" and Objective 2 is located "inside". When Objective 1 is completed "outside", Objective 2 must appear (i.e. create a collectable item, etc.) "inside".

How can I make Objective 2 appear in the "outside" level if said level is not the current level?

Notes:

  • I am currently using get_tree().change_scene(path) to switch between levels
  • I've also tried to use get_tree().change_scene_to(packed_scene), where
    var packed_scene = preload(path).instance(), but this gives me a blank screen when I try to change scene.
Godot version 3.5.1
in Engine by (12 points)

change_scene_to takes a PackedScene variant but you use an instance instead

change

var packed_scene = preload(path).instance()

to

var packed_scene = preload(path)

Please log in or register to answer this question.

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.