I have made a behavior tree with a pawn(ai) moving on a spline from point to point.
But between every spline point there is a short moment the pawn stops moving before finding the next pathpoint.
Is there a way to make this go smoothly?
There isn’t really a way to do this effectively with points. You would need to use the spline path itself.
Honestly I don’t suggest using a behavior tree for this. You’d get better results from such simple activity from just using the AI controller/ Actor Blueprint. You COULD take a lot of the functionality and put it into a BTTask.
Here are some other threads with accurate methods of moving AI’s along a spline!
You should be able to get what you need from those. Hope that helps!
If you really want to get into it, there is also this sample project/write up on how to do these things:
Hey @Mind-Brain I will take a look into the links, thank you!
The reason I want to use a Behavior Tree is that when the AI smoothly follows the path, I want the movement to interrupt when the player is to far away and play an animation until the player is close enough again.
But im going to try using the spline length / distance instead and see if that helps,
So looking here let’s go one thing at a time. You have this cast to AIC for some reason unknown as you are doing nothing “AS AIC Behavior Follow Spline”. What are you attempting to do here?
In what you highlighted;
I didn’t do anything with the AIC because I figured I had to complete the cycle of calling the character.
But what do you suggest I should do there?
In the first part of the task I basicly want to determine the duration of the spline path based on the spline length and the character walk speed;
In the sequence ;
I call the spline length
I call the AIC > continues to the character of which I call the max walk speed;
(I divide the spline length through the walk speed to get a “duration” value)
Than I call the custom event “run”
In the second part;
I call the AI controller (AIC) and connect that to a movement (because i thought the AIC controls the pawn now)
As destination I get the spline length + duration and trow that in a lerp, with the duration as the alpha
I set the lerp value as the distance I’ve walked on the spline and input that into destination.
Honestly the part you highlighted, I dont know what to do there, or if I even have to call the AIC there at all…
(I had the walking part working without a behavior tree and with a timeline, but I cant use timelines in tasks of behavior trees so I have to figure out something else)
If you see the whole scenario, am I doing something stupid?
I’m a bit inexperienced but trying to learn and I appreciate your help a lot <3
(edit after I posted this reply, I just removed that “call AIC”, I don’t see the reason to do that either)
So this is the new part 1 of the task;
It’s working, for the most part. You’re learning (as we all still are!) so once it works figure out how to refine it and that’s what you’re needing right now. So let’s put a pin in all this for a moment.
This is for an NPC, so braking isn’t as important. This might give you the overlapping movement you need-
Try opening your character movement component and messing with the BRAKING setting on your walk. If the braking is turned way down it may try to slow down early, if that’s the case you could tune acceleration as well.
Also- most of the stuff you mentioned in this previous post is true. I don’t think I’ve ever added a custom component for AI though… HOWEVER there are so, so many ways to do things with UE5 and that’s part of the appeal!
Mess with the braking and acceleration and lmk how it goes!