- Home /
Ragdoll breaks and flys far into the air...
So, I've been using 3DBuzz Third Person controller tutorial. All has been going well, even having to update things that no longer work. That is until Ragdoll death.
I'm nearly certain that my Ragdoll is set up correctly, and that the problem is in the line of code that loads the Ragdoll.
ragdoll = GameObject.Instantiate(Resources.Load("Ragdoll"), transform.position, transform.rotation) as GameObject;
is the code from the Tutorial. But when applied as is, the ragdoll flies away. But when I remove the transform.position ans transform.rotation, it works (almost. As intended, just at world center, not at the character)
ragdoll = GameObject.Instantiate(Resources.Load("Ragdoll")) as GameObject;
The ragdoll crumples as it should, just not in the right spot... I tried transform.localPosition as well, and no difference. any hints as how to get the proper location without it flying off?
Flies in the air? Perhaps its too close the the ground and beco$$anonymous$$g ejected from the terrain collider. The other thing to try, if it has a rigidbody, is to zero the velocity after it's spawned.
Your answer
Follow this Question
Related Questions
transform position y changes when character rotates 0 Answers
Following another object's position/rotation like parent/child relationship? 4 Answers
How to predict position of object before transform.translate will apply? 1 Answer
Rotation issue with remote players projectiles 0 Answers
transform.SetPositionAndRotation(0, 0, 0),SetPositionAndRotaion 3 Answers