I want the task to run only once as long as the decorator condition is true.
However the task restarts every 0.5 seconds since the service checks variables every half second.
I’ve tried many things…
-Using “Event Receive Activación” in the service but it was worse because the task is restarted a lot of times more per second than in the previous case.
-Using the “Receive Search Start” in decorator. In this case the task only runs once but then all previous services on the same branch I need to run at tick (checks ) are not working properly…
Can we see a little more of this BT/BB? There’s not a single decorator or selector that is going to solve this issue, but it is achievable.
For instance: Can we see what comes before this in the BT? The BB Variables List?
What is the desired behavior you’re looking for? From this I’m seeing “If I have the cube move to the base, if I don’t then go to the cube”, is that correct? And the issue is that the Decorator is checking every .5s and resetting from root? If that’s the case, would you mind posting the code from the Service you’ve written?
I’m thinking that your issue is going to be within that Service. Would you mind posting the code for it? You can use this website to paste your code if it’s large!
*Disclaimer: This website is not affiliated with Unreal Engine or Epic. Click at your own risk, and be careful with weird links!
1-The paw goes to look for a cube at the enemy base and then brings it to his base…
2-If an enemy is found along the way he shoots him
3-He also moves away from the path of another pawn so as not to collide with each other
Yeah, you can’t do Behavior Trees on it, only Blueprints. What I was asking was what’s inside of that Service? The one called BTService_GetCubeOwner? Can we possibly get screenshots of the code inside of there?
If we don’t hear from you tonight, hopefully tomorrow!
When I use Event Receive Tick AI. That’s when it works best. The problem is that every half second it stops a bit because the task is executed again. This is how my original problem looked.
Ok Ivan3z, thanks for the back and forth with me, really trying to help with this one!
Your original there looks great! I’m actually thinking that the issue is different. Your behavior tree on the right looks like it’s doing exactly what it should, they’re very fast and twitchy. What’s happening is this:
The MoveTo task is giving the paw a destination. They move to that destination and stop.
Upon reaching the destination, the task returns Success, the behavior tree runs through, reaches the end, and restarts from the root, which is what MoveTo is supposed to do. So there’s a new goal!
What the goal should be now is finding a way for your characters to update their destination without stopping their movement.
You might need to use a Simple Parallel but I couldn’t tell you where to use it.
Your problem has been an issue with UE in the past, most solutions I’ve seen involve using C++.
I wish I could help more but I think I’m getting out of my depth. But what I can tell you is what you thought was the problem is not the problem, it’s the MoveTo, and that’s a problem I don’t know how to solve.
Try creating a new post with that question! Make sure to include the last video you sent.
This fixes the bug… Now the pawn moves very smoothly. Show it to the development team. Maybe it will help fix the real bug in the next version of Unreal.