Order units surrounding unit to move outward?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
So for example, there are 6 units surrounding a unit inside a circle. Unit in the middle casts spell, make surrounding units move outward. Can this be done with Polar Offset? How can I do this?
 
You want them order to move outwards?

PickUnits in range...
Get angle between point of picked unit and point of caster. (angle ; real)
Unit - Order PickedUnit "move" to Position of Picked Unit with Offset of <distance> towards <angle>

I'm not sure you want this. Maybe you want them to be knocked back. Then you should look for a knockback system.
 
It's not so easy, because the units need to move outward. I don't want them to move toward the unit in center. And no to knockback, just want to order them to move there. How can I do this, more specifically?

Your method is fine, but the angle needs to be specified.
 
Your method is fine, but the angle needs to be specified.

In Iceman's above example the angle is not specified. The distance is specified.

The above example by iceman will work exactly for what you want. It will move each unit in range around the unit to a point a set distance away from the center unit.

Also note that the angle should be angle between caster and picked unit - 180.
That will cause the units to move directly away from the casting unit.
 
Also note that the angle should be angle between caster and picked unit - 180.
That will cause the units to move directly away from the casting unit.
Wait, if the caster is in the center, then angle from caster to enumunit is 'outwards', and the opposite of that is inwards
 
Status
Not open for further replies.
Back
Top