Hi, i will try to explain the better i can, so, my game is working perfect, is just a simple pong, nothing special, but when i build and make the apk with no errors, i install the game on my phone but the score doesnt work, i alredy tryed all, i dont know what i can do…
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Playerpuntuacio:MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D ( Collider2D coll){
if (coll.gameObject.tag == "ball"){
Managerintent.Scoreplayer++;
}
}
}
This is the sript from the " collider "
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Managerr : MonoBehaviour {
public Text textScoreplayer;
public Text textEnemiplayer;
public static int Scoreplayer;
public static int scoreenemy;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
textEnemiplayer.text = scoreenemy.ToString()+ " ";
textScoreplayer.text = " " + Scoreplayer.ToString() ;
if (scoreenemy == 21) {
Gameover ();
}
if (Scoreplayer == 21) {
Gameover ();
}
}
void Gameover(){
SceneManager.LoadScene (5);
}
}
and this is the manager, i repet all is working in unity but not on my phone …