I have a missile trigger. The spell can be unit target or point target. When it is a unit target I also check if the unit is moving.
This is complex so for the brainy ones out there.
If the target is moving I set the angle of the missile to a new point. I need this new point to be where the target would walk if it continued at its normal speed. This allows the missile to hit the target even though they have moved.
So I have:
The casters position
The speed of the missile
The targets current position
The targets move speed
The facing angle of the target
So I need to know the angle to fire my missile to hit the moving target.
This is complex so for the brainy ones out there.
If the target is moving I set the angle of the missile to a new point. I need this new point to be where the target would walk if it continued at its normal speed. This allows the missile to hit the target even though they have moved.
So I have:
The casters position
The speed of the missile
The targets current position
The targets move speed
The facing angle of the target
So I need to know the angle to fire my missile to hit the moving target.