I am trying to have a very simple prefab be created at run time, it is just a Plane’s primitive with a texture attached to it and as far as i can tell it should working, but it does not show up where it should.
Here is the script that I am using, it is attached a large Plan primitive, just created with the Game-object Menu.
using UnityEngine;
using System.Collections;
public class Spawn_squares : MonoBehaviour {
public GameObject mod;
// Use this for initialization
void Start ()
{
for(int i = 0;i < 10;i++)
{
for(int j = 0;i<10;j++)
{
// mod = GameObject.Find("PlaneS");
mod = (GameObject)Instantiate(GameObject.Find("PlaneS"),
transform.position,transform.rotation);
Debug.Log("HEllo"+i);
}
}
}
// Update is called once per frame
void Update () {
if(Input.GetKey(KeyCode.A))
{
transform.Translate(new Vector3(0,-1,0));
}
}
}
Well, you could at least give me a link, and also tell me why it freezes unity when i hit play.
– ArthurABullIs it just taking a long time to make the planes or are you just not seeing the planes? Look in the hierarchy view to see if the planes are getting created. If they are getting created then: [http://answers.unity3d.com/questions/412718/plane-not-showing-up-in-game-view.html][1] [1]: http://answers.unity3d.com/questions/412718/plane-not-showing-up-in-game-view.html
– robertbu