I want to make a backstab spell so I don't want to let the unit cast it if not waching his back. So I thought to check the facing like that:
Abs(Facing of Caster-Facing of Target) < 90
but this doesn't work cause let's say facing of caster is 350 degrees and facing of target is 10. Then then backstab must be done but the difference is not <90 so it won't let him do it....I mean that's not the way to check if the caster looks the back of the target. Can someone help me on how a backstab spell is done?
Abs(Facing of Caster-Facing of Target) < 90
but this doesn't work cause let's say facing of caster is 350 degrees and facing of target is 10. Then then backstab must be done but the difference is not <90 so it won't let him do it....I mean that's not the way to check if the caster looks the back of the target. Can someone help me on how a backstab spell is done?