every time i try to write public void Text it’s giving me error?
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour {
private Rigidbody myRigidbody;
public float moveSpeed;
public float speed;
public AudioSource collectSound;
public GameObject text;
public int count;
public Text countText;
// Use this for initialization
void Start () {
CountScore();
myRigidbody = GetComponent<Rigidbody> ();
}
// Update is called once per frame
void Update(){
//this is automovment that means player is moving alone
myRigidbody.AddForce (new Vector3 (1, 0, 0) * -speed);
}
void FixedUpdate () {
//movment on button
float moveHorizontal = Input.GetAxis ("Horizontal");
Vector3 movement = new Vector3 (0.0f, 0.0f, moveHorizontal);
myRigidbody.AddForce (movement * moveSpeed);
}
public void OnTriggerEnter(Collider other){
if (other.gameObject.tag == "pickUp")
;
{
Destroy (gameObject);
AudioSource.PlayClipAtPoint (collectSound, transform.position);
text.SetActive (true);
count = count + 1;
CountScore();
}
}
void CountScore(){
countText.text = "Coins: "+ count.ToString;
}
}