I am building an interaction component and would like to know if it is possible to change the length of the line trace needed to interact with an object in an instanced based manner. Meaning, Object A can be interacted with at 5m (original length) but Object B has to be within 3m (new length), with the original length reset back to 5m when not needing or wanting to interact with Object B. Object A may be a big Actor and Object B may be a smaller Actor.
Base trace length is 1000.0f, with interaction range 500.0f and I have a function to set a new interaction range.
Inside another script or in BP, if new trace length is set on begin play, it overrides it for EVERY actor looked at and not just the one trying to be interacted with.
It wouldn’t make sense to update the length when we look at the object because, if the trace length to the object is less than the original, a new length is set, thus telling the component, we are not looking at the object anymore, and resets back to original length. But the pawn would still looking at the object with a trace length less than the original, setting back to new, creating a loop.
If there is not a known way, I’ll just omit changing the length of the trace.