I am struggling a bit to find the best way to handle the scenario in the subject. I have tried a lot of different methods but there has to be a standard way to handle such a common object setup.
I have a hovering drone with animations, some that do not make sense to apply to the parent node (ai controller gameobject) so I have the animator in a child object so that it can “hover” up and down in place. It also has animations such as spinning around, which is best to apply to the entire object. There is also a rigidbody to handle externally applied forces from explosions and such. On top of all this I also apply a blend tree to lean the flying robot forward/left/right for it’s movement.
the hierarchy of this setup is:
Parent(components: Seeker, aistarcontroller, rvoController, aipath, raycast modifier, custom state driven enemy controller)
child(0) (components: rigidbody)
child(0).child(0) (components: animator and animationController)
To handle this I currently update the rigidbody gameobject to match the parent, but still experiencing a lot of disconnects with the ai pathfinding and the actual rigidbody.
Writing this out, I know it seems obvious to apply the rigidbody position to the parent/ai controller but I am positive that was the first thing I have tried and cannot remember why that wasn’t working well.
How is this normally handled? I have to believe it is a pretty common thing to have animations disconnected to the pathfinding agent, with instances of rigidbody interactions with the environment in an enemy agent.
I have a chart of the different elements mapped out (not sure if this is valuable at all, might be out of context for the reader to understand)
Any help is much appreciated, I have spent a considerable amount of time trying to find a better solution.