I want to make a character controller with the iskinematic function for all of his body parts. But I want to know if the function move vector, works, when an arm or leg, is set to kinematic. I cant do that.
How can I first convert all the ragdoll to non kinematic? And then how can I use a vector 3 translate or move, to move a non kinematic character?
Hi! May be something along these lines will help? That’s how I do it when I need to switch the ragdoll state:
void Update()
{
if(condition == true)
{
foreach(Rigidbody rb in GetComponentsInChildren<Rigidbody>())
{
rb.isKinematic = true;
}
}
else
{
foreach(Rigidbody rb in GetComponentsInChildren<Rigidbody>())
{
rb.isKinematic = false;
}
}
Vector3 dir = (target.position - transform.position).normalized;
dir *= speed * Time.deltaTime;
transform.Translate(dir, Space.World);
// or if you want to use your character controller...
//characterController.Move(dir);
}