So I’ve been able to find a solution to all the problems I’ve come across until now so I’m asking for help.
I’m on the eighth video in the roll a ball tutorial, (https://unity3d.com/learn/tutorials/projects/roll-a-ball/displaying-text) and got to 7:45 in to the video where I had just finished coding some scripts. I go back to unity and it says I have compiler errors. I go over the script and it looks identical to the tutorial save where I had named some things differently. So I “fixed” what the error messages told me to address, but all that did was break the code and made more errors.
Hopefully you can identify what I’m doing wrong. The following is my code, and the error messages.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PlayerControl : MonoBehaviour {
public float speed;
public Text countText;
private Rigidbody rb;
private int count;
void Start ()
{
rb = GetComponent<Rigidbody>();
count = 0;
SetCountText ()
}
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 ("PickUp"))
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText ()
}
}
void SetCountText ()
{
countText.text = "Count " + count.ToString ();
}
}
Assets/scripts/PlayerControl.cs(18,9): error CS1525: unexpected symbol ‘}’
Assets/scripts/PlayerControl.cs(37,17): error CS1525: unexpected symbol ‘}’
Assets/scripts/PlayerControl.cs(45,1): error CS8025: parsing error
Thank you. I hope you can help.