Render object infront of another

If i were to render an object infront of any other objects in the scene, how would i do that?`

Remeber, its not only to render the visual side of the object, but also be able to click on the object even if there is 10 other object infront of it!

Also, yes i have been searching for days now and i wasn’t lucky enough to find anything usefull for me.
I would appricate any help, thanks :slight_smile:

You could try rendering to texture, and then compositing that texture on top of the main screen in a post processor. You would have to clone the camera settings of the main renderer to make sure it matches up.

Regarding clicking, you’d have to set up the hit/trace channels to ignore objects that shouldn’t be clicked, or you have to implement your click handler such that it knows to treat these objects as special.

Okay, so for the rendering part for visual i can do and know how to, but what you are saying for the click part is that i have to raytrace it? isn’t there any other way to without having to raytrace it?`

If not, then oh well i’ll raytrace :slight_smile:

Another option if you always want the object to render on top is to use a translucent material with depth test disabled.

3 Likes

Yep already know that, but that doesn’t solve the click problem¨
But thanks, appricate the help :slight_smile:

Trace for Objects. Set up a new object type, ignored by all. Set the gizmo (this is about that gizmo thingamabob, right?) to that object type.

You could then even get away with:

image


  • new object type

  • on the gizmo

  • this trace can interact with this gizmo only, you do not even need to check for a blocking hit because this traces ignores everything else

  • the controller handles it:

image

But you can use the other tracing methods for this, too:

This is by far one of the most optimised way to detect stuff in the world.


More about filtering:

3 Likes

How would i only be able to detect my gizmo? is there way to target only gizmo on the cursor raycast?

I apologize for all these questions, i am used to code, not visual scripting and with unreal there are some few specific things one has to follow, like getting the player controller and etc for thing s:smiley:

1 Like

Oh yes! Updated the post above.

You are amazing dude!
Thank you so mutch

1 Like

Is there way to make the child of the root in a blueprint have the same collision presets, without having to enable it on each of them? :slight_smile:

Not with a tickbox but can be scripted. Untested but should work. Fingers crossed.

1 Like

Just one last thing, i am not a fan of having to specify collision within the engine itself, instead of making it with blueprint. I might be wrong here but is that the only way?`

I had some custom solutions with a form of my own raycast system, but it was a workaround and would mutch rather have inbuild system from blueprint to work with, duo to the performance cost overtime can be alot with custom solutions

But this is all blueprints. It’s a really common thing to do.

Thats correct, i think its just a personal thing haha

Your post was updated but if you’re looking for a way to filter things further, consider using tags. Each component of an actor can be tagged:

You can query tags:

The above could be handled in a more elegant way, I admit. Just a quickie.

1 Like

Its like you can read my mind haha, i was just looking into that now! Thanks buddy!

1 Like

@Everynone Is the raycasting detection based on the mesh collision or the vertex of the mesh?
Is there a way to change the detection radius?`:)

image

Trace Complex traces against mesh polygons (or triangles). Disabling it would trace against the simplified collision. There is no ‘radius’ here unless we’re talking about sphere traces.

I guess at huge distances you may need to deal with float precision.

1 Like