How to set up custom depth on a recursively spawned actor (surface-oriented mouse cursor)

Hello. I have created a surface-oriented mouse cursor, similar to this example How to setup a surface oriented mouse cursor. Now, I would like to add custom depth to it, so that it doesn’t go through the corners of walls like so


, but rather appears on top of them. How could I achieve this? Thank you.

Have a look at what decals can do:

Sounds like that’s what you’re looking for.

I am finding that decals will bend to accord with the mesh geometry. This is why I opted for spawning a partially transparent plane. What I’m looking for is for this plane to appear over top of every mesh like so:


Much appreciate it!

Look into decal tri planar projection ← that’s the keyword to search for. As in:

https://www.unrealengine.com/marketplace/en-US/product/x-decal-tri-planar-projection?sessionInvalidated=true

There’s should be some examples around. Don’t have the definitive tut at hand.


bend to accord with the mesh texture

Geometry, right?


What I’m looking for is for this plane to appear over top of every mesh like so:

Not sure if I’m recommending the right technique. Are we talking about disabling depth? Now that I read the topic again, it seems that you want something entirely else than I thought. My bad.

Thanks for the response. What I’m looking for is for my spawned actor (mouse cursor) to receive location and rotation from real geometry and to spawn on the desired location, however, to appear over top of all geometry (from my research sounds like custom depth). I am providing a video for reference on how the cursor works, and what I’m looking for is to avoid if falling through geometry.

PS. I looked into Triplanar UV’s and I’m not sure that that is what I’m looking

avoid if falling through geometry

Still not not sure I get it. Which part of this is undesirable?

imageimage

What would be the ideal way to have it displayed?

The second one is undesirable, I would like to see the whole cursor at all times. This would be an example of the way I would like to see it displayed How to set up custom depth on a recursively spawned actor (surface-oriented mouse cursor) - #3 by flyingmonkey398

Thank you very much!

1 Like

But this can be achieved by disabling depth test on the material, no? Is that it?

I was able to get custom depth to work by changing my blend mode to on the material from mask to transluscent, and then ticking “Disable Depth Test”. However, this boxed in my plane into a single color and thus the circular mask of the cursor shape was lost. Is there any way to achieve custom depth while maintaining the material blend mode at “Mask”? Thank you very much!

Can you show the material? Are you piping alpha into Opacity?

I don’t know if it can help, but your transluency method in prost-processing must be set to raster to work (if set to raytracing, depth test will not disable).