- Home /
Touch Object Android/IOS
Hey Guys, I'm trying to get away from scaling GUITextures for different phones by raycasting and touching an object to load a certain level. Would anyone be able to help me or does anyone know a handy upscaling or resizing script for gui textures? Here's what i have so far -
var hit: RaycastHit; private var layerMask = (1 << 8) | (1 << 2); function Start() { layerMask =~ layerMask;
} function FixedUpdate() {
if (Input.touchCount == 1)
{
var theTouch: Touch = Input.touches[0];
if(theTouch.phase == TouchPhase.Began && guiTexture.HitTest(theTouch.position)) {
var ray = Camera.main.ScreenPointToRay(theTouch.position);
//var GUIRay = GUICamera.ScreenPointToRay(theTouch.position);
if(Physics.Raycast(ray,hit,50,layerMask))
{
Application.LoadLevel("LevelSelect");
}
}
} } Thanks so much in advance :D
Comment
Your answer
Follow this Question
Related Questions
Obtaining twitter user PIN directly in-app? 0 Answers
Android/IOS First Person Shooter 2 Answers
Cant add AirPush ads on IOS. 0 Answers
Multiple Tiled GPU warning: RenderTexture color surface errors? 0 Answers