0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ゲームオーバー表示

Posted at

unity始めたばかりの初心者です。

public class Title : MonoBehaviour {

int status;

// Use this for initialization
void Start () {
	
}

// Update is called once per frame
void Update () {
    if (Input.GetKeyUp(KeyCode.Space) && status == 0)
    {
        status = 1;//ゲーム中
        title.gameObject.SetActive(false);
    }
    else if (transform.position.y <= -140.0f)
    {
        status = 2;//ゲーム終了
        title.text = "GAME OVER";
        title.color = Color.yellow;
        title.gameObject.SetActive(true);

    }
    }

}
上のコードでtitleの部分がエラーを起こしていますが、理由がわかりません。どうしたらいいのか教えてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?