I know I saw a script like this in the unity wiki, but I cant seem to find it. Does anyone know what its called? It creates a variable object where you click.
Not that i heard of, but i think you can try instantiating objects when Input.GetMouseButton(0) is true. Sorry canβt help much, just went through the wiki myself.
Hello bgivenb,
very easy.
Just use the following instruction
private var v3Position : Vector3;
var touches = Input.touches;
var touch : Touch;
touch = touches[0];
var ray = touchCamera.ScreenPointToRay (touch.position);
if (Physics.Raycast (ray, hit, 10000))
{
v3Position= touchCamera.ScreenToWorldPoint(Vector3( touch.position.x , touch.position.y, hit.distance - 85));
}
the ScreenToWorldPoint will convert your touch into a v3 coordinate in world. touchCamera is a variable set to your current camera.
β-85β is just a constante to create your object 85 units up of your touched game object.
hit.distance