Index

MoveTowardsAndAvoid

MoveTowardsAndAvoid(<-start <-target <-delta <-minHeight <-checkRange <-checkCreeper <-checkAC <-checkPseudoTerrain) ->pos

Description

Takes a starting 3D position (a 3-vector) and generates a new 3D position that is moved towards the target (also a 3-vector). The resulting point will not be displaced more than the delta argument.

Examples

#Move a unit towards a destination and crawl over creeper, anticreeper, and shields
GetTerrainVector(42 23) ->target
 
0.1 ->speed
1 ->minHeight
SetUnitPosition(self MoveTowardsAndAvoid(GetUnitPosition(self) <-target <-speed <-minHeight 1 true true true))

Index