I am working on a little melee fighting game.
I have a function where my AI is trying to figure out how far the player is.
The player can run around in any direction, he can also ascend or descend stairs.
I wasn’t even sure how to raycast, in every single direction.
I am doing it by getting the two locations and subtracting them as shown below.
(at least that is the start of it, there is a bunch of ‘rube goldberg’ nodes after that
to check different directions, and deal with unsigned and signed numbers)
The brute force function gets the job done, but I want to know if this is the best
approach to the problem.
Is a raycast more efficient in this situation, and if so how do I set that up?
A typical ‘rube goldberg’ solution
my solution