So is there any direct way to trace against objects that are actually visible on-screen? Or is the solution to toggle the trace channel together with the visibility in BP?
But the above will not work if the object is outside of the camera frustum, ofc, but the Recently Rendered handles that.
Or is the solution to toggle the trace channel together with the visibility in BP?
That’d work, too. Note we can add custom channels / object types which helps achieving the sometimes necessary granularity of who can interact with whom.
Those solutions would work to check if the result is valid or not, but would make the “Get Hit Result Under Cursor” useless… I’d have to trace again - ignoring the invalid hits - until hitting something that meet the criteria (of being recently rendered).
Pretty much, yeah - Get Hitis tracing (from the camera towards the cursor) but automated and set up in the player controller:
Do not trust the clicked part, it’s lying.
Perhaps you could share what the overarching goal is - there may exist a neat solution; there may be none besides laborious flag checking and double traces.
I am guessing you want to ignore traces against objects that are not being rendered. If so, perhaps the objects themselves can periodically check whether they are being rendered and flip their tracing channels to Ignore. Feasible?
Pretty much, yes. I’m using a Variant Manager to show/hide objects and I want the Trace to return only objects that are currently visible (so that I can “select” them and show details about the selection). Hidden objects should be ignored for this purpose.
I don’t know… It just feels that there should be an easy and obvious solution to just trace against what you can currently see on the screen. Like, if it’s rendered that it should respond to my trace. But I guess that just doesn’t exist
Never worked with it so my understanding of the internal workings is next to none.
However, since this is a singular event (rather than spamming this on Tick) that’s probably fine unless you iterate over thousands of elements. On the other hand, assuming the manager flips some assets around, isn’t there a delegate you can hook up to? What actually happens when:
using a Variant Manager to show/hide objects
Isn’t there a return of some kind that would allow you to effect the tracing channels when variants change? Something like this pseudo-dispatcher:
This may be a silly question - I simply do not know how it works.
It’s a loop in C++ that I can’t hook in to easily. The Variant Manager flips parameters of all objects that are part of the Variant Set (which you can manually set). Issue is that not all parameters can be set this way - so for example I can set “Can Character Step Up On”, but I can’t set “Collision Presets”. Seems a bit random.
Anyway, I can execute a general loop after (which is what I’m doing as per above). I could narrow down the loop with a Static Mesh Tag or something.