Hello, This is my first week working with Unity, Love it. But I am having a heck of a time with one of the tutorials Unity provides. I am working on the Project: Roll-a-Ball. Everything has been smooth. A few times I had a little hick up with scripting, but now i am completely baffled. I have followed letter by letter (except one word cause I named it differently) but things are highlighted red, and saying “… dose not exist in the current context.” even after in the video he says 'do it like this" and I would and its still not ‘right’ This is what I have typed…
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PlayerCon : MonoBehaviour {
public float speed;
public Text countText;
public Text winText
private Rigidbody rb;
private int count;
void Start ()
{
rb = GetComponent<Rigidbody>();
count = 0;
SetCountText ();
winText.text = "";
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ("pickupobjects")) {
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText ();
}
}
void SetCountText ()
{
countText.text = "Count: " + count.ToString ();
if (count >= 12)
{
winText.text = "You Win!";
}
}
}
anyone see what I’m not seeing and if so… why is it so (so i can learn from it) and what did i do differently from the video? Hope you can help. Thank you -Jade