Paper2d actors always spawning behind everything/

Anytime I spawn an emitter or text or anything its behind everything on the board. I have tried add +1 on the Y to push things in front but it seems like I can’t figure out how to get everything in front. All the actors are at 0 on the Y but anything else I spawn is always behind the actors. Any idea?

You should try using the Y axis as type of Z Index.

In web development (and I am pretty sure in 2D game development as well) you work on X and Y coordinates with the traditional Z index which determines which actor is rendered in the front.

So just try something like: Basic background: Something like -500 (so you have a paralex scrolling effect… this is for mountains and stuff like that in the background), -1 for “Foreground” background (like buildings, trees. Near the player which should not move faster / slower than the player but are still background.

0 for enemies, 1 for gameplay elements ( buttons, boxes… whatever) and 2 for yourself. That’s all just a random suggestion and you can go way beyond in structuring everything like that. Keep in mind that you wanna stay relatively close once you are in the action area since the distance between two actors on the Y axis does matter in terms of clarity of the gameplay.

Once you have that it’s a bit easier to track it down. You can also take a look on the actor during gameplay (Ctrl + F1 to release the mouse focus from the window and then you can take a look at the transforms of each actor or component in your level. So check where it’s actually being placed.

I hope this helps :slight_smile:

Cheers

Awesome. Thanks will give this a shot and see if it helps!

I was trying to have a blood effect spit out whenever the enemy is hit. So the only way I have gotten it to work is to have the particle effect above the actual enemy graphic in the components. So the enemy sprite is a child of the particle effect. If it is set this way it works, the blood always spawns in front. I can do that but I need to also do this to the Player. However, you cannot child the character sprite to the particle system because it is already a child of the Capsule Component. Is there another way to do this?

Well I’m not working a lot with particle systems. However you can try two things. Inside of the settings of a particle system you can take care that it only spreads on one axis + Z and then spawn it 0.5 in front of your actor.

That should do the trick.

I have discovered that this isnt just particle systems. I have a black static mesh thats just a plane I am trying to use to make the screen black when I push a button. It also will not spawn in front of anything. It will only appear behind all my sprites on the screen. If I set it close or on 0 on the Y it doesnt appear at all. Same as if I put it above 1 on the Y I get nothing. Only thing I can get it to appear is to set it lower on the Y (the negatives) but then it always spawns behind all my sprites regardless of the Y postition. I feel like I am doing something completly wrong, maybe in the way I have it setup. But everything is at a certain point on the Y with most things set as 0. I was using the paper 2d template.

I still have no idea how to fix this. If I spawn any actor in my 2d game it spawns behind almost everything. My background is at -500 on the y and it doesn’t spawn behind it. But anything else they spawn behind. I have tried everything to get the actor to spawn in front of my character and other closer objects and it doesn’t work. Like I said above, the only answer was to have the actor higher in priority in the components list. But in this case I need to spawn an actor on top of my player character and its always behind him.

Hey, I think you found the answer to youself after this long time, but since this question is the first entry in google if you search for the problem, I thought I just post the answer for the future ppl who have this problem.

In your Sprite setting in the “Rendering” Tap there is a setting called “Translucency Sort Priority”. The biggest number will be drawn last, that means its allways visible and the rest is behind it. If you want something be in front of the rest, give it a higher number then the rest.