Interaction Advanced System

At the start of UpdateHighlight, if NewActor == LastHighlightedActor, you can return early to skip wasted work of unhighlighting/highlighting the same object every tick. This will ensure that you will only switch objects when a different object is found by the trace.

if (NewActor == LastHighlightedActor)
{
   return;
}

For figuring out performance problems, you should look at:

My suggestion above is just a guess. Profiling code is the only way to really figure out what is causing performance problems. It is often not what you would guess!

1 Like