Line trace Infinity

Im trying to implement some firing mechanics and id like to Line Trace with an infinite end distance but i dont think there is a node for Infinity in blueprints.

Is my only option for “infinity” just creating an absurdly large number, like multiplying the end vector by 999999999999999 or something?

I would have thought infinity would be a simple and easy to implement blueprint node.

Any advice?

I think that there’s no way to implement infinite Line Trace, and that you have to get a finite number of your choice.
In my humble opinion, I think it’s intended : even if Line Traces don’t use that much computing, what if the Trace don’t touch anything ? Does it go infinitely ? If you fire 200 times in the void, will this slow your game ?
If you want to fire a bullet you fire it to the direction you’ve chosen, but you need to decide of a limit. Anyway, I don’t think deciding that your bullets can’t go further than 5 km is really disabling :slight_smile:

1 Like

Collision checks are optimised in a way that a a check for a triangle would not be performed if it is beyond the line’s limits. Having infinite lines would mean that at any time half of the map would be considered for collisions which is a heavy computational task.

Fair point makes perfect sense, thanks for the input.