- Home /
Question by
rohanbanerjee · Jun 18, 2015 at 06:54 PM ·
prefabgetcomponentinstancehingejoint2d
Remove HingeJoint2D from the Instance not from the Prefab
Iam trying to remove the HingeJoint 2D from the instance. But after I do that, all the objects instantiated from the prefab have no HingeJoint2D !! The problem is it removes the HingeJoint2D from the prefab rather than the instance. Here's the code:
Destroy(gameObject.GetComponent("HingeJoint2D"));
// Above code is attached to the object which has HingeJoint2D
//Problem is after the component is removed, all the objects instantiated
//do not have HingeJoint2D !!
//My Goal is to remove HingeJoint2D from the instance not the prefab !!
Any help is appreciated !!
Comment