Required Pickups

If you want to make it possible to continue to the next level only once all the coins have been collected, try this.

  1. Update flag.gd to check that a specified node is empty before changing level
  2. Ensure that coins get removed from the scene on pickup
  3. Update levels to tell the flag what pickups are required

1 - Update flag.gd

@export var required_pickups : Node
func _on_area_3d_body_entered(body):

	if required_pickups and not required_pickups.get_child_count() == 0:
		# Required pickups not picked up yet!
		return
    
    ... existing code

This adds a new property to the flag inspector that lets os select a node that needs to be empty before we can switch level.

2 - Ensure Coins get Removed From the Scene

Currently, coins are just hidden and disabled on pickup. We need to fix that.

		$Mesh.queue_free() # Make invisible

to

		queue_free() # Remove from scene

3 - Update Levels

In each of your levels do the following:

Reparent to New Node

It should look something like this:

Step 1

Assign button

Try it out!

Of course, it would be nice to tell the user why you can’t move to the next level. Once you’ve completed the Menu and Menu Signs guides you can use the same mechanism to display a text.