What exactly do Eyes look for when you tick Require Sight?
Posted: Thu Apr 20, 2017 2:47 pm
So I was wondering what exactly are a faction member's eyes looking for when a deed is ticked as Requires Sight? I have a situation set up in which I am having trouble getting a faction member to witness a deed that is being performed upon them.
It is like this:
- The Player fires a bullet at the faction member.
- There's a script (or in this case, a Playmaker action) on the bullet that, upon impact with the faction member, reports an Attack deed from the Player to the faction member.
- The deed has an impact of -80, so when it is successfully reported, the faction member's affinity to the Player drops quite drastically.
All of this works perfectly if I set the Attack deed to NOT require sight, and to have an infinite reporting radius (set to 0).
But what I would like to do is set the radius to around 10, so that only faction members in the local area are able to witness the attack, and to have it so that if the Player were to attack the faction member while in hiding, then they would not be able to witness it.
I'm having a little trouble with this however and would like to ask a few questions :
- When performing a sight check, what exactly does a faction member's eyes look for? Is it the other faction member that is performing the deed, or would it be whatever object the script is placed on (so in my situation, would it be the Player or the bullet)?
- And when looking for their target, would I be correct in assuming that the eyes perform a raycast to the target's origin point (the Player's feet in my situation)? And if so, is it possible to offset this so that they might look for another part of the target (if they were to look for the Player's torso rather than their feet, then I imagine the sight check should prove to be more reliable)?
- Also, and this is not related to my current problem, but is it possible to have the eyes operate with a cone of vision rather than a circular radius? So if the Player were to perform a deed while another faction member is within reporting range but is looking in the opposite direction, they would not be able to witness the deed?
And just to point out, the Eyes object for my faction member is an empty game object that hovers just a little way above the faction member's head away from any colliders, so I can confirm that there is nothing blocking its line of sight.
I apologise for the wall of text, I just wanted to make sure I explained everything clearly. And very nice job on the asset by the way.
It is like this:
- The Player fires a bullet at the faction member.
- There's a script (or in this case, a Playmaker action) on the bullet that, upon impact with the faction member, reports an Attack deed from the Player to the faction member.
- The deed has an impact of -80, so when it is successfully reported, the faction member's affinity to the Player drops quite drastically.
All of this works perfectly if I set the Attack deed to NOT require sight, and to have an infinite reporting radius (set to 0).
But what I would like to do is set the radius to around 10, so that only faction members in the local area are able to witness the attack, and to have it so that if the Player were to attack the faction member while in hiding, then they would not be able to witness it.
I'm having a little trouble with this however and would like to ask a few questions :
- When performing a sight check, what exactly does a faction member's eyes look for? Is it the other faction member that is performing the deed, or would it be whatever object the script is placed on (so in my situation, would it be the Player or the bullet)?
- And when looking for their target, would I be correct in assuming that the eyes perform a raycast to the target's origin point (the Player's feet in my situation)? And if so, is it possible to offset this so that they might look for another part of the target (if they were to look for the Player's torso rather than their feet, then I imagine the sight check should prove to be more reliable)?
- Also, and this is not related to my current problem, but is it possible to have the eyes operate with a cone of vision rather than a circular radius? So if the Player were to perform a deed while another faction member is within reporting range but is looking in the opposite direction, they would not be able to witness the deed?
And just to point out, the Eyes object for my faction member is an empty game object that hovers just a little way above the faction member's head away from any colliders, so I can confirm that there is nothing blocking its line of sight.
I apologise for the wall of text, I just wanted to make sure I explained everything clearly. And very nice job on the asset by the way.