Download

Line-trace every tick vs sphere overlap performance?

Hello,

For my AI character, I am debating whether I should have a sphere collision or perform a line-trace every tick in order to determine when he’s in range to attack. Which is less costly?

Thank you!

Less costly is checking vector distance every frame…
Only then you call a physics trace or sphere overlap, when distance <= x.

That… actually makes a lot of sense, I don’t know how it didn’t occur to me. Thanks!