Simple follow [No python, no track to]

Hello fellow designers, I was having a big problem with track to for the AI to track the player in my game! The problem is that being on a spherical terrain, the objects don’t use their local axis for the tracking, but global. Therefore, once you are at the equator or near it, the objects tend to spin on the Y axis.

The solution was to find a way to fake it with radar and 2 empties.
The advantages of radar is that in this case, the bots automatically track to the closest. And hopefully don’t have the axis problem (didn’t test it yet).

The disadvantage I found is that there’s no priority tracking, meaning that if 2 objects are in range on opposite sides, the tracker won’t move [because it can’t decide which to track first, besides they don’t know which one is the closest] that’s why it’s a simple system and works fine if there’s only one object to track.

Later on I might add a near sensor to the empties, to help the tracker decide the closest target.
I attached the blend, just in case…

Attachments


radar.blend (163 KB)

The idea is nice, but I think it would slow down the game a lot if use a lot of these…

Well I believe is not as much as a ‘track to closest object’ script X n objects. I actually for this method because it’s simple and works [to a certain point]without any code; but also cause didn’t have much choice.
The ‘track to’ sensor doesn’t work on a spherical surface: If my character is standing on the equator of a sphere, and I use the track to (even with 3D enabled), the bots will indeed track to the player, but also orient themselves globally, in other words, they wont stand.

runs fine…good idea

Thanks, it’s a pleasure! I think it’s simple and efficient!

nice animation… can u explain to me about tutorial how to make “radar.blend” . i need it to finishing my project. thank’s

@torakunsama - Actually, the script would probably be faster, especially if it were compiled. Also, I believe that even faster than a ‘track to script’ X n objects would be a ‘track to script for each object’ for just one master object.