- Home /
There is no 'Rigidbody', but there is.
"MissingComponentException: There is no 'Rigidbody' attached to the "Bip01 Pelvis" game object, but a script is trying to access it. You probably need to add a Rigidbody to the game object "Bip01 Pelvis". Or your script needs to check if the component is attached before using it."
Enemy dies, gets replaced with Ragdoll enemy when health reaches 0. This is the script on the ragdoll, which i want to add force too:
#pragma strict
var destroyTime : float = 10.0f;
function Start () {
addForce();
Destroy(gameObject, destroyTime);
}
function addForce()
{
gameObject.Find("Bip01 Pelvis").GetComponent.<UnityEngine.Rigidbody>().AddRelativeForce(-transform.forward * 3000);
}
I do have a Rigidbody on the pelvis. I've tried looking up answers, but i legit can't fix it, scripting isn't my thing :/
Answer by Dream_in_code · Aug 29, 2016 at 04:43 AM
After getcomponent add Rigidbody2D not rigidbody only
UnityEngine.Rigidbody2D>()
Yo, thanks for the help btw bro, you think you could help me with my second question? It's on my profile, bai ^^
Your answer
Follow this Question
Related Questions
How to implement Mob movement / death ? 1 Answer
adding force to instantiated ragdoll 4 Answers
Bullet add force to ragdoll help 0 Answers
How can i flip a ragdoll ? 1 Answer
Add force on Instantiated Ragdoll 1 Answer