- Home /
Target matching on moving object
Hello, I am stuck with this issue. Imagine I have a humanoid character on the roof of moving object like a school bus. The character can on the roof go forward/backward, jump/crouch. All of this movements are fine. Also the character can strafe left or right to the edge of the roof. And here is the pickle.
Due to animations error the strafe has each time different length and the character is slightly shifting. Which leads to the situations that after several strafe left/right movements, the character isn't landing exactly on the middle of the roof and also when on left or right he might end with one foot off the roof.
I hoped that target matching will help with this, but there is a catch. Since the bus is moving the targetPosition and targetRotation (in world space since target matching function needs world space coords) are not valid before the animation of strafe ends.
So my question is - is there a way how to do target matching on moving object ? Or is there another way how to do it ?
Thanks