- Home /
Question by
Owlserker · May 28, 2015 at 07:33 PM ·
scripting problemtutorial
Error CS1519: Unexpected symbol ';'
im trying to do the first tut and i ran into this error, ive went over it like 30 times and i even made it to an almost exact copy of the videos example. anybody can help me that would be amazing.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class playercontroller : MonoBehaviour {
public float speed;
public TextCountText;
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 ();
}
}
Comment
Answer by DoTA_KAMIKADzE · May 28, 2015 at 07:33 PM
Correct those lines:
//Line #8 to:
public Text countText;
//Line#42 to:
countText.text = "count: " + count.ToString();
works perfect, and i was just talking to a friend about how capital letters can do alot of difference in coding. thanks a million.
Your answer
Follow this Question
Related Questions
Getting errors with Color type 0 Answers
Refrencing Monobehaviour in the Editor 3 Answers
In-Game Tutorial with special actions in special areas. (Shooter) 0 Answers
Script I copied from Movement tutorial doesnt work 2 Answers
Having trouble with LoadAll 1 Answer