Trying to solve why stuck in wait and also how to design my tree to behave right

aphixe

New member
Trying to figure out why gets stuck in wait. all wait has on it is a random from 3, 7.. I thought if player gets out of view then it will go back to wander but this didn't work for me.

I have some youtube example and the tree and it's settings. The walls are layer Wall, ground is Floor, we have a player with tag Player. Enemy set to Layer Enemy.

The end goal would be enemy is wandering around trying to find player. when spotted run up to player hit and run to near wall to hide from players view and go back looking for player and continue. later on i'd like to have it say if player goes to attack it goes and runs away. maybe a sub tree idk. but i'd like to solve the basic flow first.



tree1.png
candetect.pngseektree.pngcovertree.png
 
It doesn't look like the tree is actually stuck on wait, rather it is completely ending after wait. Wait will return success, which then pushes that up the chain and causes the tree to end. You have a lower priority abort set which is getting the tree out of wander, but you don't have a fallback beyond that. Maybe you want to attached a repeater that repeats forever to the root?
 
Okay adding a Repeater before selector seems to get it out of wait and goes back how I expect. now i need to figure out how i can get it to run away hide and cover a wall. I messed with Flee it before cover it mostly works. Unless you can think of a way to have think am i in view of player. I'm not sure about if conditions in bd pro. And I have a seek here but i noticed there is no way to break out of a seek, player can run super far way or be out of range of enemy and the enemy will always go to you. So i have to program a seek+range ability that says if player is out of an area it goes back to wandering looking for the player.

Also I have SensorToolkit 2 and A* Pathfinding Project Pro, not in this project, if these tools would be a good choice to get the desired effect
 
Looks like I am understanding some stuff now. I do now wonder if Stacks or subtrees or something can help me run a parallel check for enemy, so not only does enemy have to see the player but can hear them as well. I got it right now working as far as if the player isn't in range it fails and goes back to wandering
 

Attachments

  • newTree.png
    newTree.png
    219.5 KB · Views: 3
Glad you are making progress. I recommend that you take a look at this page - it provides a structure that sounds like it will fit your design:

 
I tried stacking visual and sound didn't seem to work or my sound isn't working on my player character. it just uses standard character controller from unity, i could switch it to UCC. or do i need to run them separate.
 
The Stacked Action task will run one after another, so if one fails then the other will not run. I'm not sure if that's your problem but it sounds like it could be. Those tasks do not require our character controller.
 
how do i run a see and hear task in a way that either can be true, i think selector, with "Lower" but it kinda works but I maybe doing it wrong. i tried to find the graph example that shows this, I went and downloaded integration and imported and looked for sample in integration folder but there was no scene to open. this is from your link above.
 

Attachments

  • currenttree-help.png
    currenttree-help.png
    191.3 KB · Views: 1
You can place both tasks within the StackedConditional, then set the Comparison Type to Selector on the conditional task.
 
Back
Top