- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
Stovepipe · Dec 17, 2014 at 09:59 PM ·
errorroll a ballparsingparsing errorunexpected
Unexpected "{" and parsing error (roll a ball tutorial)
I've been doing the "Roll a ball" tutorial, and i thought i had done everything as it needed to be. But it keeps nagging me about 3 errors. If anyone please can explain to me what i've done wrong, i'd really appreciate it.
using UnityEngine.UI;
using System.Collections;
public class PlayerController : MonoBehaviour
{
public float speed;
public Text countText;
private int count;
void start ()
{
count = 0;
SetCountText ()
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rigidbody.AddForce (movement * speed * Time.deltaTime);
}
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Pickup")
{
other.gameObject.SetActive(false);
count = count + 1;
SetCountText ()
}
}
void SetCountText ()
{
countText.text = "Count" + count.ToString ();
}
}
Comment
first obvious one:
void start ()
should be
void Start ()
case is important...
Try changing the two line like this :
SetCountText ()
to this :
SetCountText ();
second is a missing semicolon on this line:
SetCountText ()
semicolons are important too ;)
and you missed that twice...
3 errors. done.
Answer by Paulocmfo · Dec 17, 2014 at 10:49 PM
Type using UnityEngine; beneath the line using UnityEngine.UI;
Your answer
![](https://koobas.hobune.stream/wayback/20220613174253im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
CS8025 Error (Parsing Error) 1 Answer
Parsing Error : Unexpected symbol 'end of file' 2 Answers
Unexpected error 1 Answer