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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Make AI turn while fleeing from Player

Hello All, I'm trying to get my AI to turn while fleeing. It will run away after losing about 70% of its health. But while it flees, it tries to face the player. All this works as intended, except the AI kind of "snaps" around to face the player. I'd like it to smoothly rotate while fleeing and then rotate back in the direction of movement periodically.

Here is a link to the screen cap of the Blueprint:

http://imgur.com/14jE1kC

Here is a link to a YouTube video that shows the behavior, as is:

https://youtu.be/VsV8yzXr9E8

Thank you in advance for any help! ~angel

Product Version: UE 4.11
Tags:
more ▼

asked Aug 24 '16 at 11:36 PM in Blueprint Scripting

avatar image

JigSaw73
16 1 3 4

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

3 answers: sort voted first

Answering your question Live: https://www.twitch.tv/victorburgos_

more ▼

answered Aug 25 '16 at 03:43 AM

avatar image

VictorBurgos
2.4k 60 27 111

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

If you have Character Movement, so a Character class, you can set Orient Rotation to Movement, otherwise, you can probably lerp to the new rotation gradually.

more ▼

answered Aug 25 '16 at 03:50 AM

avatar image

VictorBurgos
2.4k 60 27 111

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

Hi Victor, yes it is a Character Class that I am using for this AI. The Orient Rotation to Movement box is checked/positive already. Also, under Class Defaults the Use Controller Rotation Yaw is not checked/negative.

Actually, I think root of the problem is that the character is traveling away from the player. When the Behavior Tree fires, it re-orients to face the player which is away from the direction of travel (away from the forward movement). It just snaps. I don't know how to lerp to that new rotation when that branch of the tree fires...although that would seem ideal, yes. I was trying to achieve that with "Delay" but it's not working. Would that be another task placed in front of the "flee" task? I'm going to go watch your last Twitch stream now - thank you for taking the time!!!

more ▼

answered Aug 25 '16 at 12:54 PM

avatar image

JigSaw73
16 1 3 4

(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