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 to make a flying AI that follows the player?

As the title says, how I make an AI (like a sphere) that follows the player in the 3d sidescroller template? I'm rather new to Unreal Engine and using blueprints but I've done some things by looking at other posts and questions that other people have had before. As for now, The "AI" is not moving at all or doing anything interesting. Here are some pictures of what I've done so far: alt text alt text

The first picture is the actor and the second is the controller class. I know I've done something wrong, would appreciate any help.

Product Version: UE 4.20
Tags:
screenshot1.png (204.4 kB)
screenshot2.png (173.9 kB)
more ▼

asked Dec 19 '18 at 04:25 PM in Blueprint Scripting

avatar image

E4ce
1 1 1

avatar image E4ce Dec 21 '18 at 02:35 PM

I wasn't clear enough in my question. What I want is a "sphere" or something similar that can be placed anywhere in the 3d sidescroller world and when the player comes close enough the sphere will engage and move to the player.

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

2 answers: sort voted first

Have you looked into Unreal Engine's AI features? There are behaviour trees with which you'll have an easier time implementing AI. May I suggest you have a look at this: https://docs.unrealengine.com/en-US/Engine/AI/BehaviorTrees/QuickStart

more ▼

answered Dec 19 '18 at 04:35 PM

avatar image

Lupix
86 1 4 3

avatar image E4ce Dec 19 '18 at 05:12 PM

Wow, making an "AI" in UE4 was much more in depth than I thought. This might help.

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

if you are just aiming to have a very simple AI that follows the player... the following solution doesn't need AI

I'd just use a spring arm setup... but put your AI character on the end of it. You can put the AI in your Player Character BP, use a separate AI Rig (with AI mesh component and spring arm component) that is a child of your Player Character, or just on Tick constantly set the AI Rig location at your Player Character.

The length and relative rotation of your Spring Arm component, along with Socket/Target Offset will give you the offsets that you need.

VERY simple to set up, VERY performance efficient and the spring arm position lag & rotation lag will provide really nice smoothing

more ▼

answered Dec 19 '18 at 11:45 PM

avatar image

aNorthStar
938 8 17 20

avatar image Nebula Games Inc Dec 20 '18 at 06:32 AM

Agree with the above....unless your "sphere" is actually going to do something "intelligent" it doesn't need to be "artificially intelligent" (AI). Following the player can be easily done with a spring arm or parenting etc.

avatar image E4ce Dec 21 '18 at 02:34 PM

Sorry I wasn't clear enough in my question. What I want is a "sphere" or something similar that can be placed anywhere in the 3d sidescroller world and when the player comes close enough the sphere will engage and move to the player.

(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