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"

How can i get onhear and onsight etc(AIPerception) in c++ PLEASE help!!!

Hello. Im working on making and AI using AIController and AIPerception in it. I've set up sight and hearing but i have no idea how to get on hear and on sight kind of thing used in old pawnsensing. So basically i want AI to do something when heard something and i dont know which function i need to use, where i can code. Please help. I have asked question related to AIPerception(c++) before and its been more then a week now and didnt get one answer.

Product Version: UE 4.21
Tags:
more ▼

asked Feb 15 '19 at 06:12 PM in C++ Programming

avatar image

GameGod786
3 1 2

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

What you're asking for could be done a couple different ways. I think the easiest would be attaching a collision object on your ai and increasing the size based on sight range. Once an object collides with the collision project you can draw a raycast from the ai's "eyes" and if nothing collides inbetween then you could return true. The hearing would work pretty much the same way without the raycast.

more ▼

answered Feb 16 '19 at 11:08 AM

avatar image

Gameartist3d
1

(comments are locked)
10|2000 characters needed characters left

Thank you for replying. Ya it can be done like you said. Also the one thing that im really struggling with is Senses. I have AIPerception set up. I also have OnTargetPerceptionUpdated function. The problem is this OnTarget will be triggered for all Senses. But what i trying to do is have Ai react differently on sight and hearing. Is there a way to target specific sense?

more ▼

answered Feb 16 '19 at 12:20 PM

avatar image

GameGod786
3 1 2

(comments are locked)
10|2000 characters needed characters left
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