hello,
we are having hard time with a weird problem. we are instancing some objects on some objects.transforms.
when we test it in editor it works well but after the build nothing gets instanced nor we can`t see the prefabs anywhere.
i have made the simplest scene with this script below and it still not showing in the build.
var cube : Transform;
function Start () {
for (var y = 0; y < 5; y++) {
for (var x = 0; x < 5; x++) {
var cube = Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity);
}
}
}
// simple copy paste from documentation
no errors in the log, and no problems with the prefabs as i have tested.
This may not be the problem, but try taking out the var cube =. That cube variable may be getting confused with the cube variable you declared at the top of your program. Just something to try if you haven’t already.
Hi, i have kind of the same problem, Im following the FPS tutorial so I created a prefab sphere and asigned it as projectil in the inspector. (i want to shoot spheres)
I’ve just tested something similar with Plane and cube objects and it appears to work fine with that as a prefab. I am doing this in OSX so this may be a windows only issue. I’ll do some more testing and see if I can narrow it down to other objects too
var cilindro : GameObject;
function Update () {
if (Input.GetKey("f"))
{
var InstanciaCilindro = Instantiate (cilindro);
}
}
Still not working, I just created a Cube and give it some phisycs to make it fall, everytime y press f on Unity it blows if i do it outside It doesn´t…