Hello, I’m attempting to make a blueprint (single object for now) where I can highlight and unhighlight an object. I’ve created a post process material and managed to set up the line trace by channel node in my character blueprint, I’ve also managed to get it to turn on the highlight (set render custom depth) when a collision with the object is detected. The problem I’m facing is how to remove the highlight when the lines are no longer colliding with said object. I’ve tried a method already (shown below), and this method doesn’t work as the object continues to stay highlighted even when lines aren’t colliding.
Line traces are not persistent. Only way to get them close to persistent is to fire one every x millisecond. BAD for performance.
Anyway you need to think “Toggle”. create a boolean in your object… Off? (default true).
Trace-> on Hit → check interface → Branch[Off?]
Off? is True: Highlight on → Set [Off?] False
Off? is False: Highlight off-> Set [Off?] True.
Yes I was thinking of a different way to do this but nothing came to mind. Do you have a less cost effective solution that does not require line traces?
Depends on exactly what is needed. Details on what you are trying to do would be helpful.
e.g. have pick up items in the world highlight when I’m close enough to pick them up.
Items that are interactable (look at it, press E, action happens)
Also I tried the method you described and it did work, although the item needed to be highlighted begins to flicker on and off, as if the Boolean (Off?) is constantly being set to true and false.
First approach was based on a single trace hit. If you have trace hooked to tick, then it will flicker.
Items that are interactable (look at it, press E, action happens)
You’ll want to add a sphere collision component to the character class and one on the Items. You can use a custom obj channel (project settings → engine → collision).
e.g. Interactable (ignore)
On both the character and item have it ignore all, overlap interactable.
On Begin Overlap → Highlight on
On End Overlap → Highlight off
Thank you, the collision detection method (on begin component overlap) was the easiest to implement and provided favorable results.