Behaviour tree/move to - not working as expected.
So far I have got my AI to wander around randomly until it senses the player. It then chases the player until it loses sight of the player for about 10-20 seconds. It will then search for the player for a further 1-3 minutes. If it doesn't find the player then it forgets about them and goes back to wandering.
The problem is when it goes back to wandering it walks all the way back to where it first started, even if it has been chasing the player for miles. what I want is for it to just wander around the area that it reached after chasing/looking for the player.
The wander task is set to pick a random point around the AI and then walk there using the 'Move To' task node so why does it walk all the way back to where it started? Surely it should pick a new target point nearby when it goes back to wander?
I'll compare it to mine tomorrow when am not on phone...and see what the options are. You can try connecting the get actor location target to your zombie cast 'as zombie' compile and see what that does. Might take whatever location your current zombie is at when it gives up looking and starts this task , wandering within a radius of wherever its current location is.
If it continuously changes cuz it's location does. You may need to set the current location into a variable so that that variable stays as that origin point and doesn't change each time the task is run. Set the variable with a do once or something.
answered Jul 04 '15 at 07:29 AM
Post your Wander Task graph here.
Without seeing it: I'm guessing you're using the get random point in radius node. If so, then you're specifying the start point of this node. "origin". Is it the spawn location? that would explain why. At the end of your "give up looking" function, get the current location of the wandering actor and have it set that as the origin for the wandering task rather than whatever it is now?
answered Jul 03 '15 at 11:16 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here