If the target-unit is moving a missile can still track it.shizuo wrote:I just wonder if you can make a moving target and the missile still keeps on tracking the target while dancing.
There are two ways for missiles to dance:
1) engine physics: Missiles have "wobble" and "dance" parameters that randomize their movement: https://springrts.com/wiki/Gamedev:Weap ... leLauncher
How reliably such missiles tracks their target mostly depends on whether their tracking "turnRate" can compensate the randomness.
2) It depedends whatever you do with the existing Lua projectile-functions. The "dance" tag can be re-created with Spring.SetProjectilePosition() to give more control, for example to make the movement less random the closer the projectile comes to the target.
The "wobble" tag would require Spring.SetProjectileDirection() (I guess like https://github.com/spring/spring/blob/d ... .cpp#L2745 but proj->dir instead of proj->pos)
Even without SetProjectileDirection a projectile could dance a lot or fly in a search-pattern before it eventually becomes accurate.

