Search Unity

Instantiated object collider not working?!

Discussion in 'Editor & General Support' started by Saturnix, Nov 22, 2012.

  1. Saturnix

    Saturnix

    Joined:
    Nov 2, 2012
    Posts:
    13
    Hello,

    I'm instantiating an object like this

    Code (csharp):
    1. var cube : GameObject;
    2. Instantiate(cube, Vector3.right, transform.rotation);
    Part of the cube GameObject include a rigidbody and a box collider. Why the original cube collider works when falling on a plane while the instantiated one suddenly falls off the plane as instantiated? I've tried to lower the plane, but I have the same problem.

    One cube falls on the plane correctly, the other pass on it as it has no collider.
     
  2. OrbitusII

    OrbitusII

    Joined:
    Jul 4, 2011
    Posts:
    175
    Are you using a prefab to instantiate it, or are you just cloning the object? I'd recommend using a prefab if you're not changing parts of the gameobject dynamically (besides its position).