How to spawn an actor behind the HUD?

Hey guys,

I have in my project a scenario, that the “manager object” spawns images (like particles)

The problem im having is that those spawned particles are being spawned infront of the scene and covering the HUD of the game, how can I spawn those particles but make sure they remain behind the hud?

Or at least at the same  “z depth” of their spawner.

EDIT:

Iv’e tried to spawn the images and add them to the group, and thus maybe they will be in the same layer

But the function that spawns the images is located in a different Lua file, and I can’t get access to the group from the main.lua file

Roy.

Hi there,

you can control the depth by passing a number as the first parameter when you insert the particle in the scene.

Ex.

if you do group:insert(particle), the particle will appear on top of everything else that was inserted before.

if you do group:insert(1,particle), the particle will appear bellow everything else that was inserted before.

Hey marcior,

Thanks for trying to help!

The function spawns the images is located in a different Lua file “particles.lua” and the group is on a the “main.lua” file…

Any idea how to insert the spawned images to the group even though its different files?

Roy.

If your hud is in a group, (or if it’s by itself too), just do a:

hud:toFront() after you spawn things to move the hud back on top (assuming your hud group is called hud)

Cheers Rob

I ended up making the group global so I can insert the spawned images into it from the other lua file,

I hope its a valid solution…

Roy.

Hi there,

you can control the depth by passing a number as the first parameter when you insert the particle in the scene.

Ex.

if you do group:insert(particle), the particle will appear on top of everything else that was inserted before.

if you do group:insert(1,particle), the particle will appear bellow everything else that was inserted before.

Hey marcior,

Thanks for trying to help!

The function spawns the images is located in a different Lua file “particles.lua” and the group is on a the “main.lua” file…

Any idea how to insert the spawned images to the group even though its different files?

Roy.

If your hud is in a group, (or if it’s by itself too), just do a:

hud:toFront() after you spawn things to move the hud back on top (assuming your hud group is called hud)

Cheers Rob

I ended up making the group global so I can insert the spawned images into it from the other lua file,

I hope its a valid solution…

Roy.