Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make AI move when im not looking but not move when I am look

Hey Guys, Im just Making a basic jump scare horror for my friend but i dont have any idea to make the blueprint. I want the character have the effect that it pop up behind the player then when the player look behind it magicaly appears there, its like a jumpscare effect. Please do tell me if im not explaining the problem well.

Product Version: UE 4.7
more ▼

asked Jun 08 '15 at 01:42 PM in Blueprint Scripting

avatar image

1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You could do a check to see if the AI object is being rendered which would be very accurate, but I suspect it will be difficult to do.

An easier approach would be to find the dot product of the forward vector of the active camera and a look at vector from the camera to the AI object. Dotting the two vectors will give a result in the -1 to 1 range with -1 meaning the view is completely opposite where the object is, 0 meaning the object is perpendicular to the camera view, and 1 meaning the view is looking directly at the object. Knowing the FOV of the camera, the size of the object, and a bit of trial and error, a cutoff value ensuring that the object is not in view can be found.

What is missing from this method is having the AI move when obscured by objects between the player view and the AI object itself. You could add some line traces from specific points on the AI object, if any of them reach the camera or player and the camera is within the cutoff point for visibility, it must be assumed that the player can see the AI object.

Alternately you could have limited visibility range and do a check if the camera is within that range. Another way to overcome the player potentially locking the AI in place by keeping the camera pointed in its direction could be to simply teleport it away for a time and then reinsert it somewhere in the players vicinity.

Good luck scaring your friend :D

more ▼

answered Jun 08 '15 at 03:40 PM

avatar image

471 9 14 35

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question