Hello, I am currently having an issue regarding behavior tree functions. I am using a function in which is supposed to rotate the AI Character to the direction to where the enemy is facing but for some reason the function does not correctly work. I have made sure I have all the variables correct and the Behavior tree does recognize that the enemy actor exists but the rotate function continues to stay stuck. Is there more to this than I originally thought? Thanks
Hey there Martinez!
Have you tried unlinking that selector there? That way we might be able to narrow down the issue.
Try running the game with the BT window open on the side. Make sure you select the correct actor in the window so you can get real-time feedback, and confirm that the blackboard window (lower left corner by default) is indeed receiving an input for “Enemy Actor”.
Is it sticking on “Rotate to face BB entry” or is it continuing through?
Give this stuff a try and get that info back to us, we’ll keep hacking away at it with you 'til we get it figured out!
Hello thanks for reaching out, Here’s an image of the Behavior Tree of what originally occurs when running the game:
I have also tried unlinking the sector that you mentioned and ran the game. However, it still did not properly execute the rotation correctly and the characters still remained doing nothing. I have also made sure to check the input for the enemy actor and it’s correct as well. The issue still undergoes with the rotate function being stuck forever
Note: The rotate function states: “enemy actor focal point is an invalid location”
Did you set Use Controller Rotation Yaw on your AI Pawn? If not, this could explain, why it is not rotating.
Hey again Martinez, thanks for getting that for us!
@herb64 Great suggestion! This is a pretty common misstep.
So @ChunkyCat, to get to that variable you’ll want to open your AI Pawn BP, and under “Pawn” you’ll see “Use Controller Rotation Yaw”. Make sure that is NOT checked!
Also (assuming you’re using a walking character) to improve your character’s rotation you will want to open up your character movement component
And go to the details panel on that. Go to the character rotation category, and set the Z axis rotation to anything above 0 (lower number is slower, I like 180), then check the “Orient Rotation to Movement” box.
Not necessary to fixing your problem but it’s a nice improvement when using “Rotate To Face BB Entry”.
Give that a shot and let us know how it goes!
Thanks for reaching out again. I have followed what was mentioned (Unticking rotation yaw and set rotation rate to 360). Yet still unfortunately the problem still persists. Is there any other additional information that may help pinpoint the situation? I appreciate the help for far!