Announcement

Collapse
No announcement yet.

On sight interactivity on player camera

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    On sight interactivity on player camera

    Hi, I am trying to create a new mechanic for a horror game, where if the enemy is the view of the player, it will become hostile and attack. When designing the mechanic, my thought process was that the player camera would have a trigger as a child to it that is the same shape as the camera view, and if the pawn of the enemy entered the trigger, the event would fire, but I am having some trouble getting a trigger volume attached to the player character. I was wondering if anyone would be able to point me in the right direction, and if this type of system would not work, would anyone be able to give me some advice as to how this mechanic could be achieved?

    #2
    I swear I saw a function for this *somewhere*.
    For the life of me I can't recall what it was called.

    In any case, its would be easier to get the dot product of direction to the player compared to the direction the enemy is facing.\
    If that is withing a certain threshold, do a quick trace from enemy to player.
    If that succeeds, the enemy has seen the player.
    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

    Comment


      #3
      Try to add SensingComponent
      Click image for larger version

Name:	c47.PNG
Views:	1
Size:	206.9 KB
ID:	1072075
      Website [ LINK ]
      Twitter [ LINK ]
      Support ! [ LINK ]

      Comment


        #4
        Thank you so much! The PawnSensing component worked!

        Comment

        Working...
        X