Quantcast
Channel: Answers by "luniac"
Viewing all articles
Browse latest Browse all 34

Answer by luniac

$
0
0
Ok i fixed it... apparently i had to connect the script to the camera, instead of an empty gameobject like i had... also this is my updated working code...
var blue : GameObject;
private var mousePos : Vector3;
private var worldPos : Vector3;
function Update () {
	if(Input.GetMouseButton(0)) {
		mousePos = Input.mousePosition;
		mousePos.z = 1.5;
		worldPos = camera.ScreenToWorldPoint(mousePos);
		Instantiate(blue,worldPos,Quaternion.identity);
	}
}

Viewing all articles
Browse latest Browse all 34

Latest Images

Trending Articles





Latest Images