I'm sorry for not replying to you guys earlier, I just went apartment hunting in Munich and my camping site surprisingly didn't have any internet.
@Muppetpuppet
I think there's little I can do without a test scene. I have no idea why your actors are behaving the way they are. If it is too difficult to create a test scene from your project, you could also send me an NDA and then I could have a look directly at your project.
@Yanifska
You're the second person who says that unity crashes on smooth turn. I will need to investigate this asap.
For now the failed event is only called if you did something wrong in the action setup (eg if you follow a path that does not exist). I reimplemented the failed event as an event that is sent when the final node position is further than the failed distance away from your target position, but apparently I forgot to add this to the latest release. In such an event it would not even start to move the actor, though having an option to move the actor to the closest valid node and to then send the failed event sounds quite useful.
As for follow vs followTo : Follow will stop moving once it's within finish distance of the target, but it will continue following the target once that target has moved away again. FollowTo will send a finished event once it's within finish distance of the target.
Perfect finish will add the target position as a last waypoint to the path. This means no matter where the real calculated path ends, it will always beeline from the last node on the path directly to the target. It is useful if your target is an empty that might be "between" some nodes.
The reason why your actor is jittering without the Perfect Finish mode is because you are most likely using an Absolute Finish Distance Mode . This means, it will only finish the movement action if the distance between the center of your actor and the center of your target is less than the FinishDistance. This is never true, because the distance between the last node on your path and the target is bigger than your FinishDistance. This is why absolute should probably only be used with high FinishDistance settings, eg when you have an archer that has a long range attack, and you're making him attack something, then you first need to move to the target position, but if he's maybe on a mountain ridge he would not have to move all the way down to shoot his arrow if the target is somewhere below him. In this case an absolute finish distance check is what you need.
Ok, so let me list all the problems for the recent version up, so I can work on fixing them:
-
- Smooth Turns somehow crashes
- FailedEvent still not dependent on FailedDistance
- LateFailedDistanceCheck option (to first move to the closest node, then do the failed distance check)
- Fast actors on dense graphs cause errors (This is something that I personally need to fix, though it might take a lot of effort)
- Shadow problems (beelines)
I also think it might be for the best to implement a "simple" and "advanced" mode, where the simple mode could hide and auto-set some options to make it easier to create a working/non-stuttering action for people who just started using this.
Bugfixes I've made so far (just a list for me
) :
- Time.frameCount <= 1 in the path creation and the OnUpdate function to produce valid paths even if the user spawns the actor before the graphs are initialized.
- added debug log message to check your real start and end path position (regarding the beeline issue, it seems that's because the target position is equal to the actor position at the time when the action first starts)