Quick answer: Use System → Create Object with an explicit layer parameter, not Sprite → Spawn Object which inherits the spawner’s layer.

Player on layer “Background” fires bullets via Spawn Object. Bullets appear behind walls drawn on “Foreground”. Spawned objects went to the player’s layer; you wanted them on the gameplay layer.

Spawn vs Create

Two actions for instantiation:

The Fix

On player shoots:
    System Create object Bullet on layer "Gameplay" at Player.X, Player.Y

Bullet appears on the gameplay layer regardless of player’s layer. Z-order correct relative to walls and enemies.

Default Layer Property

If you always want a specific object on a specific layer, set it on the object itself:

  1. Select the object in the Project bar.
  2. Properties → Spawn Layer Option = “Custom”.
  3. Set Spawn Layer = “Gameplay”.

Now Spawn Object on this object always uses the Gameplay layer.

Layer Index vs Name

You can pass a layer name (string) or index (int). Names are stable across reordering; indices change. Always prefer names for cross-layout consistency.

Verifying

Shoot a bullet. Inspect the bullet sprite in Play mode; it should be a child of the Gameplay layer in the debug inspector. Visually: bullets should draw in front of background but behind UI.

“Spawn inherits layer; Create lets you specify. For multi-layer scenes, use Create.”

Audit Spawn Object usage when adding new layers to a scene — previously-correct spawns may end up on wrong layers post-restructure.