x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to use make an AI detect light source and avoid it?

Hi, I am making an AI for a horror game and my AI will detect light source and avoid it. I have tried to search here, google and youtube. Maybe the keywords i'm searching for is not good enough that I cannot find anything about it.

Would like to know how to implement one in event graph for my AI.

Product Version: UE 4.21
Tags:
more ▼

asked Jan 20 '19 at 02:53 PM in Using UE4

avatar image

Bonicx
1 2 1

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

1 answer: sort voted first

You would need to work with collisions and traces for that.

The lights relevant to your AI should have a Sphere Collision on them, so when the AI enters its radius you begin tracing to see if there's any direct line of sight. When they leave the sphere, yo stop tracing to them.

You could do a single trace to the center, or several to different parts of your character if you need it to be more precise.

more ▼

answered Jan 20 '19 at 03:25 PM

avatar image

Evigmae
1.7k 8 4 8

avatar image Bonicx Jan 21 '19 at 06:48 AM

That can be done in the behaviour tree ?

avatar image Evigmae Jan 21 '19 at 07:54 AM

Yes it can. You could do all the checking and tracing from a Service node.

(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