- Home /
Question by
DanyalKazmi91 · Aug 16, 2017 at 06:43 AM ·
instantiateobject
hello ! I want to instantiate a line on x axis. i have written the following code. i want to instantiate a line on x axis on touch please help
void Update () { if (Input.GetMouseButtonDown(0)) {
var mousePos = Input.mousePosition;
mousePos.z = 2;
var objectPos = Camera.main.ScreenToWorldPoint (mousePos);
Instantiate (ball, objectPos, Quaternion.identity);
}
}
Comment
Your answer
Follow this Question
Related Questions
Lock rotation of an instantiated object to another 1 Answer
Have a Timer Counts To 5 sec. Then Make a Sphere Appear While Using Instantiate 1 Answer
Object instantiation Logic Javascript. 1 Answer
How do I instantiate certain objects to appear in a specific spot? 3 Answers
Instantiating droppable items on destroy game object 1 Answer