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 get my enemy AI to rotate as they patrol?

I have enemies placed around my level on patrolling patterns, but I cannot figure out how to get them to turn on the spot before continuing, instead of cutting to the direction they're heading. As of now, I have the controller rotation yaw activated, but what I read tells me to have that disabled, yet I don't understand. I also have an Orient Rotation to Movement in my enemy blueprint, but I don't understand how to use it.

Thanks in advance!

Product Version: UE 4.7
more ▼

asked Aug 23 '15 at 01:41 AM in Blueprint Scripting

avatar image

6 1 3 3

avatar image PeteX Aug 23 '15 at 10:17 AM

Unless they patrol into a dead end, and have to turn right round, it might look odd if they stopped completely and turned on the spot. You probably want them to turn by walking along a curve. However, it's not obvious how to achieve that either, and in fact I would like to know for my own game.

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

2 answers: sort voted first

The only suggestion I have is to create your own PathFollowingComponent derived class. Currently, most of the variables of that class are not accessible to blueprints.

This variable: uint32 bStopMovementOnFinish

controls if they come to a complete stop before continuing to the next move to location.

For the visual component just follow up with an AimOffset blendspace for the animation of the character looking at his target location.

Hopefully that helps. =)

more ▼

answered Aug 23 '15 at 01:56 AM

avatar image

2.3k 114 62 234

avatar image CrazyDeafBrony Aug 24 '15 at 12:43 AM

Unfortunately that doesn't really help, yeah. Is there a way to get this to work with what I have, which is simply the pathfinding code for all enemies within the level blueprint.I thought about adding a rotation component in there, but I don't know what to put,

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

We did this by having the behavior tree, on arrival at a destination point, take a few seconds to rotate to the new target, then set a new Nav Point and go there.

It took a little blueprint code.

  • A DesiredFacing and a DesiredFaceingFlag that is the direction the Zombie should face and whether it is active. The character turns over time to that facing.

  • A Task that waits until the Character is faceing within 1 degree of the desired faceing.

more ▼

answered Aug 24 '15 at 04:07 AM

avatar image

SND R Keene
968 31 120 113

avatar image CrazyDeafBrony Aug 26 '15 at 12:28 AM

I see. And is there a tutorial for me to be able to follow so that I can easily understand this concept?

(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