You don't have to read all the code, my question is a bit further down. Thank you for helping :s
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class mouseball : MonoBehaviour
{
public float speed;
private int count;
public Text countText;
// Use this for initialization
void Start()
{
count = 0;
setcounttext();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0, moveVertical);
GetComponent<Rigidbody>().AddForce(movement * speed * Time.deltaTime);
}
void OnTriggerEnter(Collider other)
{
Debug.Log("trigger");
if (other.gameObject.tag == "pickup")
{
other.gameObject.SetActive(false);
count = count + 1;
setcounttext();
}
}
void setcounttext()
{
countText.text = "Count : " + count.ToString();
}
}
The lines that the error is referencing to are:
void setcounttext()
{
countText.text = "Count : " + count.ToString();
}
I tried but couldn't find the solution which is prob are easy one, I'm grateful for any help.