I’m not very good at ECS and I could really use some help getting a few things out of FollowerEntity agents to facilitate the creation of a locomotion system that can smoothly transition before, during, and after an off-mesh traversal.
It means that I need to gather certain pieces of information BEFORE the agent actually hits the off-mesh link because I would like to take greater control of the agent’s movement.
I may also have to trigger the off-mesh traversal sooner (because the transition often doesn’t occur without waiting for the agent to perfectly center itself onto the start of the off-mesh link.
I didn’t want this post to get longwinded so I made a diagram to clarify what I’m looking for.
NB: All motion of the agent will be controlled by external scripts and Root Motion!
Hi there- from what I can see, I can’t think of a way to find future links without FollowerEntity.GetRemainingPath(), however that will be fixed next patch. Unfortunately not much there besides possibly waiting for the patch’s release. Sorry about that
For number one however, you may find FollowerEntity.steeringTarget useful? Getting the current position and subtracting it from the steering target would give you a good direction of where the unit is going- is that what you’re trying to achieve there?
Is the steeringTarget the same as the “Path Point” I was looking for? If so, that’s great, it’s one out of three.
GetRemainingPath(), when it’s fixed next release, will hopefully provide me the other two. In the meantime, I’ll just concern myself with all manner of other things I need to work on.
steeringTarget would basically be the immediate next place they’re trying to get to. To quote the documentation, “This is usually a point a small distance ahead of the agent or the end of the path.”
Basically imagine it like the next place they’d need to put their foot on a long walk.
Your image described needing a “current 3D position”, but also needing “where the agent is trying to go”, which I think means basically the next closest point along the path towards the goal. That’s what the steeringTarget would be.
But yes, next release should help you a lot, good luck with the other parts of your project!
Revisiting this then, @moat you could still use steeringTarget as the “Path Point” from your example, but you’d definitely need to do some math to make the point a certain distance in the direction towards the steeringTarget (or just the direct point itself, if the steeringTarget’s distance from the agent is less than the distance you’d want the Path Point to be offset from).
I guess play around with it and let me know if you need any more help getting that one going
Yeah, I’ll probably just clamp the magnitude of the offset between the steeringTarget and the character.
Also, big big release just dropped today, seems that GetRemainingPath’s exception throw (with off-mesh links) has been fixed. I’ll see how that goes!