Co-Planar Collision Sorting

Hey,

Lets say for example we are going to create a 2D game, so objects all objects are co-planar we would have to introduce a concept of what is in front of what for rendering and collisions.

Is there any way to achieve something similar with UE4 in 3D? Say we have multiple objects that are co-planar and I want to assign some value to them to tell things like the ray cast intersection which actor comes first is that possible already?

I know you could offset each actor but some value, but I’d rather they were co-planar.

Let me know if I need to explain the situation more clearly.

Thanks

Hi Maddius,

Have you looked into using Paper 2D? Paper 2D does not (yet) have any display ordering for sprites, but it does allow you to use 3D collision with 2D sprites, so you can offset the sprites slightly and still have the collision that you need.

If you are instead wanting to make a 3D game where movement is constrained to a single plane (similar to the Side Scrolling Template), that gets a little more difficult. The Engine does not have a way to have all of your game objects in a single plane and specify which objects are rendered in front of other objects.

The second scenario is what I would like. Are there any classes I can override to implement this?

Hi Maddius,

I am very sorry for the long delay in getting back to you. We do not have anything that you could override to provide the functionality you are looking for. You might be able to get away with using 3D Imposter Sprites. These are 2D sprites that are designed to give the appearance of being 3D. Depending on your needs, you might be able to use these instead of an actual 3D object to render something “in front of” an actual 3D object.

Alternatively, if you want to be able to do something like send a raycast from the camera to hit an object that is “behind” another object, you can create custom collision channels for raycasts that tell them to ignore specific objects.

No worries, I did implement a solution using collision channels in the end, I’ll try to post it to the Wiki soon but it’s pretty simple in that you use TraceMulti for that collision channel then sort the results based on the user defined setting, worked perfectly.

Thanks for your help.