Jump to content
Unity Insider Forum

SueNerdy

Members
  • Gesamte Inhalte

    5
  • Benutzer seit

  • Letzter Besuch

SueNerdy's Achievements

Newbie

Newbie (1/3)

0

Ansehen in der Community

  1. Hallo Community, ich bräuchte eure Hilfe. Und zwar hab ich eine Spieler-Figur und zahlreiche Objekte, die fallen. Nun hab ich es hinbekommen, dass die Objekte gezählt werden und veschwinden. Nur wie lass ich sie willkürlich respawnen? Das Script sieht folgendermaßen aus: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Coin : MonoBehaviour { private int coinCounter; public Text scoreText; // Start is called before the first frame update void Start() { coinCounter = 0; } // Update is called once per frame void Update() { } void OnTriggerEnter2D(Collider2D other) { if(other.tag == "Coin") { coinCounter++; Destroy(other.gameObject); scoreText.text = "Score: " + coinCounter.ToString(); Debug.Log("Score: "+coinCounter); } } } Kann mir bitte jemand helfen? Grüße SueNerdy
×
×
  • Neu erstellen...