RTS Track to point, (for individual units)

So my problem is that I want a system where I click on the unit, then to a position, and the unit will go to the position. (Just tracking to the position for now though, making the unit move toward it is easy.)
But when there is more than one unit…

http://i.imgur.com/qKvP0hT.gif

So is there a way to do what I’m trying to achieve?

I thought about having the unit object track to the position the mouse was when you click, but the track to actuator only tracks to objects, not a position vector.

own.alignAxisToVect(own.getVectTo(point)[1],0,.1)#Face target
own.alignAxisToVect((0,0,1),2,.1)# Point head up

If you’re going to use some python (as you probably need to once you start getting to issuing orders) you would be best to switch to using full code like BPR showed.
If you want to stick with the actuator you need to add an object at startup and associate it with the agent.

Something like:
target= own.scene.addObject (“target”,own,0)
tracking_actuator.object=target
own[“target”] = target

Now you can pick up the target object from the agent object, move it to where you want and have the agent track to it.

I made this and commented it out for you - https://blenderartists.org/forum/showthread.php?407170-Python-based-RTS-tasker-system

Thanks BPR! :slight_smile: