i've got a gameobject with a navmeshagent component
the ragdoll and animated characters are parented to it
when the ragdoll enters a full ragdoll state, it usually ends up going further away from the original position of the navmeshagent
i want the navmeshagent to always be close to the ragdoll
so i did this in LateUpdate()
if (state == CharState.ragdoll)
{
Vector3 temp = Ragdoll.position;
pos.position = temp;
Ragdoll.position =temp;
}
the navmeshagent is teleported to the ragdoll's position, while the ragdoll doesn't move
however, the ragdoll doesn't seem to stay where it was before the navmeshagent teleported
and in the next frame, the navmeshagent moves to the now moved ragdoll, and so the whole thing slowly moves away from where it's supposed to be, instead of stopping after all the physic forces slowly die out.
i tried different things, turned off the navmeshagent, lerped rather than directly porting, i always get poor results