Question by
n4zg · Oct 27, 2015 at 09:29 AM ·
input.touch
Input.touch webgl doesnt work
Hi im trying to get Input.touch to work on a mobile device with a WebGL port for a simple game, i using the following code :
#pragma strict
public var projectile: GameObject;
public var clone: GameObject;
function Update() {
for (var i= 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase == TouchPhase.Began)
clone = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
}
}
Any suggestions what im doing wrong, in the game preview in unity it works fine, but when loaded on a mobile device, the touch doesnt repsond.
Thanks
Comment
Your answer
