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"

Move an AI with an "onclicked" button

Hi everybody, I warn I am a noob ^^ Everything is in the title, I created a widget with a button and I would like my AI to follow me when I press it. I tried it like this : alt text

But it could not be that simple and obviously it does not work. Someone To help me in my learning? :)

Product Version: UE 4.17
more ▼

asked Sep 11 '17 at 07:24 AM in Blueprint Scripting

avatar image

29 3 5 11

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

1 answer: sort voted first

There is a lot of ways to do that, but here is one:

  • On your character, create a function that makes your AI to follow the character as you want

  • On Widget, reference your character (you may use GetPlayerCharacter or create a var on it and instance when you put the widget on viewport ) and call that function.

more ▼

answered Sep 11 '17 at 08:43 PM

avatar image

524 1 4 8

avatar image Sansblaze Sep 12 '17 at 11:02 PM

Hi, thanks for your reply, I tried to put an AIMoveTo on a function of my character but I can not, I tried with "Follow" also but it did not work (not sure to have done well ). Why can not I use the "AIMoveTo" directly on my widget?

avatar image Iotti Sep 13 '17 at 12:57 AM

The AIMoveTo requires an AIController to work on it, but also, your pawn needs a movement component to do that. Does your pawn controlled by AI has one?

avatar image Sansblaze Sep 13 '17 at 01:54 AM

he dont, but I managed with AIMoveTo using a boolean on the widget .. Now my problem is that all my AI (same BP) follow me when I press the button ..

(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