- Home /
Canvas Scaler appears to crash my game.
Hey there,
I'm developing a simple endless runner game and i've done work on the HUD, it was all well and good until i came across a problem in terms of size of my HUD Size, (some had it tiny where as others had it large).
I thought I fixed the problem with Canvas Scaler using its reference resoltuion settings, it looked great in the editor. But then I tried playing, it crashed, i tried exporting... it crashed again. I don't understand why its doing this. Please help this needs to be fixed urgently!
Cheers
EDIT
I was able to solve the problem by recovering a previous project from before I used Canvas Scaler and now I have a new problem, I try to export the game instead and it fails because of a parsing error involving this script.
using UnityEngine;
using System.Collections;
namespace WreckersRun.Player
{
public class SwipeShipController : GenericShipController {
#if UNITY_EDITOR
protected override void UpdateInput()
{
// Read the axis
float horiz = Input.GetAxis("Horizontal");
SetMove(horiz < 0.0f, horiz > 0.0f);
#endif
float halfWidth = Screen.width / 2;
if (Input.touchCount > 0)
{
SetMove(
Input.GetTouch(0).position.x < halfWidth,
Input.GetTouch(0).position.x > halfWidth
);
}
/*
if (Input.touchCount != 0)
{
float movement = (float)Input.GetTouch (0).position.x / Screen.width;
movement -= 0.5f;
SetMove (movement);
}
else
{
SetMove (0.0f);
}
*/
//#endif
}
}
}
Comment