Scoring system does not work properly
Hago un videojuego de plataformas, en el cual tengo unicamente un sistema de recolección de monedas, si estas son mayor a cierto numero puedo seguir continuar, si no tengo que volver a jugar el nivel, el problema es que he tenido problemas al jugarlo, ya que posicionando las monedas en algunas partes, al colisionar no suman un punto como debería ser, en su lugar suman 2 puntos y no he notado que exista un patrón. 416/5000 I make a platform video game, in which I only have a coin collection system, if these are greater than a certain number I can continue to continue, if I do not have to play the level again, the problem is that I had problems playing it, since that positioning the coins in some parts, when colliding do not add a point as it should be, instead they add 2 points and I have not noticed that there is a pattern.
GameController
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class GameController : MonoBehaviour { public static int Score = 0; public static GameController Gamecontroller; public string ScoreString = "Score"; Text textoPuntaje; // Start is called before the first frame update void Start() { Gamecontroller = this; Score = 0; textoPuntaje = GameObject.Find("Puntos").GetComponent(); } // Update is called once per frame void FixedUpdate() { if (textoPuntaje != null) { textoPuntaje.text = "Puntaje: " + Score; } PlayerPrefs.SetInt("PlayerScore", Score); } }
Your answer
Follow this Question
Related Questions
Set as live wallpaper 0 Answers
Why do prefabs overlap each other? 0 Answers
Scroll Rect which changes size of the number of buttons 1 Answer
Lauch google play store in unity 0 Answers
How to get tilemap in unity 5.67 0 Answers