Firstly,Have a nice day all forum members,I have an awkward problem. When I am having approached player to coin,player is not abling to collide coin.How can I do it?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MadeniTopla : MonoBehaviour
{
int sayac = 0;
public Text metin;
string Miktar;
public void OnTriggerEnter2D(Collider2D carpistik)
{
if(carpistik.gameObject.tag=="Madeni")
{
sayac+=1; //1 arttırdık.
Destroy(carpistik.gameObject);
}
}
void Update()
{
Miktar = "Coin:" + " "+ sayac.ToString(); //Burada madeni para miktarı tutulacak.
metin.text = Miktar;
}
}