code:
using UnityEngine;
public class playercontroller3 : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce(movement * speed);
speed = 10.0f;
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ("pickup"))
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText();
}
}
void SetCountText()
{
countText.text = "Count: " + count.ToString();
if (count >= 12)
{
winText.text = "You Win!";
}
}
}
errors:
Assets/script/playercontroller3.cs(37,13): error CS0103: The name count' does not exist in the current context Assets/script/playercontroller3.cs(36,9): error CS0103: The name
countText’ does not exist in the current context