How to know if an actor is hit on his front/back?
So I have a very specific scenario, a good example to keep it easy could be, imagine the typical flashbang, you trow a flashbang to the enemy, if enemy is near enough, he will be blinded.
But what about if the enemy is near enough + is looking at the flashbang?
I would like to avoid being blinded if the flash happens on his back.
How can I achieve this? I guess it should be some formula to check if player is looking at the center (location) of the explosion, right? but how? and also... I guess it shouldn´t work like with an exact value, because player has 90 degrees of FOV, so I guess formula should be something "is looking at ... from here to here?"
how about getting the look at rotation then comparing the yaw of the character to that. if its within say +/- 45 then you affect them. i made a quick little test script and it seems to work from the preliminary testing i did.
answered Mar 31 '19 at 03:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here