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:
Here is a link to a YouTube video that shows the behavior, as is:
Thank you in advance for any help! ~angel
asked Aug 24 '16 at 11:36 PM in Blueprint Scripting
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.
answered Aug 25 '16 at 03:50 AM
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!!!
Follow this question
Once you sign in you will be able to subscribe for any updates here