Im workin on a spell that looks like Forked Lightning at first but hten all of the sudden the lightnings go on to other units and dmg them too Basicly Ive made a Chain Ligtning spell that has the Forked Lightning lightning effect and made dummys that cast that spell 3-5 times on different units.
The tricky thing is , i want to make it look 100% credible so i have to make the dummys cast the spell on different units (so no double Chain Lightninging the same unit), and make sure the targets are in front of the direction the real caster is facing, and not behind. To do this i think i have to somehow check if the angle between the facing direction of the caster and the angle between the pos of the caster and pos of the target of the dummy is <=90 degrees. I know this sounds wiedr i probably didnt explain it well but i hope its understandable. The problem is lets say one of the angels is 350 and the other is 10 then 350-10=340 wich is far greater than 90, but actually the angle is only 20 degrees ...
Any ideeas on solving this problem ?
The tricky thing is , i want to make it look 100% credible so i have to make the dummys cast the spell on different units (so no double Chain Lightninging the same unit), and make sure the targets are in front of the direction the real caster is facing, and not behind. To do this i think i have to somehow check if the angle between the facing direction of the caster and the angle between the pos of the caster and pos of the target of the dummy is <=90 degrees. I know this sounds wiedr i probably didnt explain it well but i hope its understandable. The problem is lets say one of the angels is 350 and the other is 10 then 350-10=340 wich is far greater than 90, but actually the angle is only 20 degrees ...
Any ideeas on solving this problem ?