Question by
Kelvinn · Aug 15, 2016 at 01:10 PM ·
instantiateinvokerepeating
HOW TO INSTANTIATE IMAGE INSIDE CANVAS?
void start(){
InvokeRepeating ("starta",2, 2);
}
void starta(){
float x = Random.Range(-220f, 126f);
Vector3 da = new Vector3 (x,0,0);
GameObject s=Instantiate (canvas,transform.position,canvas.transform.rotation)as GameObject;
GameObject ss=Instantiate (imahe, da, Quaternion.identity)as GameObject;
ss.transform.SetParent(s.transform,false);
}
Comment
Your answer
Follow this Question
Related Questions
Trying to Invoke method: Spawner.SpawnObject couldn't be called. 2 Answers
Make a gameobject spawn before enemies spawn? (C#) 1 Answer
My script keeps crashing my Unity Editor Client. Please help 2 Answers
Simple Prefab Instantiate "(Clone)" Question 3 Answers
I'm having problems instaniating 0 Answers