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 do I make an AI Move and Shoot using BT?

Let me start by saying that UE4 is awesome and Im really enjoying learning the BT system.

As the title says Im trying to get an AI to move and shoot. In this case I am just learning the BT system and I have a simple sphere (pawn) which Ive set up to shoot a projectile.

Until now I had it set to MoveTo the players location if they got out of range. Then continue shooting (a selector).

Now Ive changed it to a custom move task using the Move To Location or Actor node.

Heres the issue. My AI can only move or shoot. But it cant move and shoot.

So I tried to use the simple parallel composite, as seen here, http://i.imgur.com/KYCr6vg.png

However, the second child never goes off and I have no idea why.

Just for clarity, heres the insides of movetoactor http://i.imgur.com/90zIsoi.png

and shoot, http://i.imgur.com/toW7VTC.png

Any advice would be appreciated.

Product Version: UE 4.13
more ▼

asked Oct 28 '16 at 10:23 PM in Using UE4

avatar image

6 3 3

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

1 answer: sort voted first

As soon as your MoveToActor task gets called it's calling MoveToLocationOrActor, which is fine, but you configure that call as LockAILogic == true, which means BT will get paused until the movement finishes. Uncheck that flag and give it another spin.

Out if interest, why aren't you using the BTTask_MoveTo?



more ▼

answered Oct 28 '16 at 10:39 PM

avatar image

MieszkoZ STAFF
7.3k 225 57 413

avatar image Ataraxic89 Oct 29 '16 at 09:44 PM

Thanks, silly me.

When i tried to use moveto, and input an actor instead of a vector, it didnt work.

Id heard it would but maybe I didnt something wrong.

avatar image Ataraxic89 Oct 29 '16 at 09:50 PM

Actually, after some testing, I found that didnt actually work.

I mean it did, but only because the "shoot" part of the BT is running. But the actual second child of simple parallel still isnt doing anything.

How do you get simple parallel to work??

(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