In the interest of polling an actor per tick, with the goal of triggering an event when distance < x,
I was curious as to what would be a more efficient operation per tick:
- Raycast to actor, get length
- Sphere collision at said distance
- Using ‘Get Distance To’
- Something I haven’t figured out yet could go here.
Bumping this because I think it’s pretty handy info to have!
Can no one answer this? seriously? Shouldn’t this be somewhere in the official docs?
Bump. I also want to know. Making mobile game and want to use the less resource intensive.
Collision should inherently be far more efficient, than any form of polling, i.e. raycast to x
I’m not a specialist, but I think “Get Distance To” is the most efficient I guess. Since it’s a single Subtraction of the two locations.
So you feel that a big collision object (like say a cone from the character’s head) with the proper collision filters set would be more efficient than raycasting and checking distance? I do know that longer raycasts are less efficient.