Download

Selector in behavior tree doesn't restart from the beginning

Hello,
So, for my AI, I was following the tutorials of Ryan Laley, and I have a problem with the last one (for those who want to see it). I have a bit the same as him, a bit more expanded to fit my AI, as you can see on the pic, and it works fine, but the thing is that the searching part, on the left, with the “HaveBeenChasing” decorator works only the first time the AI see the player, like the selector was going back where he stopped, so the patrol path, he never play the searching part again. And when I check the blackboard while playing, the chase status is “Chasing”, but it still don’t go in that part of the tree… I tried to add a decorator to the patrol path part, trying a bit to “force” the tree to do the first one before, but the AI stop there, as the status doesn’t match the condition, as it never enter the left part ever again… (the "ChangePatrolpathAccess was a part of this try).Where could I be wrong ? From what I remember, it was working before, and it seem to work on the video, so I don’t know what I did wong x)

](filedata/fetch?id=1834450&d=1605898640)

Thanks in advance for every answer !

Little edit, even when he sees me when he’s searching, so during the loop, and loose me again, he go straight back to the patrol path…

Well, this topic is closed already, why do I find a solution almost everytime just after I ask a question… The problem was coming from that part, that you don’t see on the first pic, with the “WasFlashed” :
Icon128.png
Of course it was working at the beginning, because the basic value of the enum was matching the one the decorator needed, and after trying to search again, if the player didn’t flash the monster, the value was always false, so the whole sequence was failing. I created this task because I noticed that, when the player flashed the AI, the AI stops, but when the player get out of sight, the AI was going back to searching right away, so I did that to prevent it. But I don’t know what happened, but even if I remove it, it works correctly x) But if I wanted to keep it, I just had to link it to the selector above, before the sequence with the chasing decorator.
I hate myself.

Hey, I have a question. I’m using the same tutorials as you, but I never understood how on the first one, after he made the task, how that information automatically gets fed to the TargetLocation blackboard key. Did I miss something? Also, do you know how to make a get player location task?

Hey ! Sorry for the late answer ^^


That’s how you do, you just take the actor location of the player, and put it the “Set blackboard value as vector”. The blue variable is a variable created as a blackboard reference. And to have the information getting fed to the TargetLocation :

Put the variable you created in the task (that I called vector) as editable, and you’ll be able, when you click on the task, in the details, to choose which blackboard key you want to use.

Hope it helps, and that I’m not too late x)