- Home /
Need Help with Parsing
Here's what I have:
using UnityEngine;
using System.Collections;
public class walking.player ; MonoBehaviour
{
// this is a walking animation
// Use this for initialization
void Start () {
}
// Update is called once per frame
//thanks for the tip bro
//anyways, these is the place where you press the keys in order to walk and stuff
void Update () {
if(Input.GetKeyDown(KeyCode.UpArrow))
{}
if(Input.GetKeyDown(KeyCode.DownArrow))
{}
if(Input.GetKeyDown(KeyCode.LeftArrow))
{}
if(Input.GetKeyDown(KeyCode.RightArrow))
{}
}
}
}
By the way, the format is C#. I will be doing the code myself, I just need help with this little bit.
Answer by robertbu · Dec 08, 2013 at 04:13 PM
When you get a parsing error, double click on the line examine what is going on. This is the line generating the error:
public class walking.player ; MonoBehaviour
There are two problem here. You cannont have a '.' in the name of a class and the right syntax for a class declaration uses ':' not ';'. The line should be:
public class WalkingPlayer : MonoBehaviour
By convention, the first letter of classes are upper chase.
Also you have one too many closing '}' at the bottom of the file.
Thanks. Next time I run into this, I'll set up a topic that covers all parsing errors.
Your answer
Follow this Question
Related Questions
Unexpected Symbol 'end-of-file' C# Error CS8025 1 Answer
Parsing Error 1 Answer
String can't be converted to float or int? 1 Answer
Why do I get a Parsing Error using this script? 1 Answer
Simple AI Error 8025 Parrsing error. 2 Answers