How costly is line trace?

I have some items that I want the player to interact when they are looking at the item. For this I have a line trace set up for each item and any future items to check every tick. How costly would this be? Would there be any performance issues with a lot of line traces firing at the same time?

Thanks

It shouldn’t really be much of an issue until you get many duplicates of the items on screen at once. But why make the items line trace on tick? Just set up a line trace on the player character and bind it to a click event. That way the only time you’re using a line trace is when the player wants to actually interact with an object.

Don’t have a line trace for each item. Just have one line trace that traces any objects you could run into. A single line trace on tick is pretty much negligible. I’ve used this in the past to highlight objects a player is looking at.

A single line trace wouldn’t even show up as a blip in the profiler.

Thanks for the tip, I’ve set up a line trace from the player that will help fix a problem I was having. :slight_smile: