Announcement

Collapse
No announcement yet.

Need Help: Check if actor is in the players fov

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

    Need Help: Check if actor is in the players fov

    Hi unreal forums! I'm looking to create an enemy similar to the weeping angels from doctor who or SCP 173 from scp containment breach, where the actor will move if they're not being looked at, im really stuck and would appreciate any help! Thanks!

    #2
    Hi,

    I don't know the reference you have mentioned, but if you simply want to know if an actor has the chance of being drawn on the Player's screen based on it's location (it might still be occluded by walls etc.) try this:
    Click image for larger version

Name:	isOnScreen.jpg
Views:	1
Size:	397.7 KB
ID:	1129707

    If you want to know if the actor is actually visible, you need to do some traces.

    I took this screenshot from an older project, when a fire would only change color if the Player is not looking at it. There might be easier/more efficient solutions for this, but I'm not aware of any.

    EDIT: The screenshot is form the "Fire" blueprint, so you you might use this on your 'ShyCharacter'.

    Comment


      #3
      Okay! I'll try this, hopefully it will just be this simple!

      Comment


        #4
        Okay! So I tried it with a simple print string and it seems to work pretty well except there's one odd issue, For some reason it works when looking up, down and right, but when you look to the left and the actor goes off screen it still says they are in sight. But it works every other way which is kind of weird.

        Comment


          #5
          Originally posted by Aglowglint11 View Post
          Okay! So I tried it with a simple print string and it seems to work pretty well except there's one odd issue, For some reason it works when looking up, down and right, but when you look to the left and the actor goes off screen it still says they are in sight. But it works every other way which is kind of weird.
          The -3000 hooked up to Screen Location X should be -300.
          Logitech Wheel Plugin

          Comment


            #6
            Originally posted by drb1992 View Post
            The -3000 hooked up to Screen Location X should be -300.
            Yeah I played with the numbers a bit but the left side still doesn't work.

            Comment

            Working...
            X