I have a Single Line Trace for Objects on an Event Tick to look for dynamic objects as you can see in the screenshot. If this object value changes, I want to fire an event to the original object value. I’ve tried a few different ways to do this, but nothing seems to work. Whats the best way to store the original value if it changes?
Can you provide some context about what you mean by the value of an object changing - Like the object the trace hits is a different from what it hit on the last tick, or some variable on the object the trace is hitting has changed?
Also, calling the trace every tick makes me think your implementation design might not be ideal - is there a reason you need the trace instead of using collision overlap events?
Yes, the object the trace hits is different from what it hit on the last tick.
Calling the trace every tick might not be ideal, but I think that’s the only way to do a line trace to see what the player is looking at? Obviously I’m not actually generating on every tick, its every 0.1 seconds. But I’m basically trying to create a look trigger that knows when you look at it, and when you stop looking at it.
The only way I’ve gotten it to work is to broadcast the name of the object being looked at every time the trace hits a dynamic object, which is pretty expensive.
What about simply holding a reference to the Actor from the last tick in a variable and doing a comparison check?
It’s also worth mentioning the trace can fail (Return Value: False on line trace node) which will result in no actor in the hit result.
Awesome! I’ll try this, thank you!
This worked great! Much cheaper solution. Thank you very much!