Quantcast
Channel: Questions in topic: "build"
Viewing all articles
Browse latest Browse all 4084

Raycast not working on build

$
0
0
Everything works properly in editor but when trying on a android phone, raycast not working properly. If statement is not being true. there is collider.Mouse position is correct. onpointermove works. query hit triggers enabled.I have tried with disabling stripping. public void OnPointerMove(PointerEventData eventData) { RaycastHit hit; int layerMask = LayerMask.GetMask("Default"); if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out hit, 100f, layerMask, QueryTriggerInteraction.Collide)) { text.text = "move"; int cordX = (int)(hit.textureCoord.x * texture.width); int cordY = (int)(hit.textureCoord.y * texture.height); ColorSelector.singleton.ChangeColor(texture.GetPixel(cordX, cordY)); } }

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>