Ello, i'm new to unity but I keep getting this error in my script?

using UnityEngine;
using System.Collections;

public class character : MonoBehaviour {

//movement variables
public float maxspeed;

Rigidbody2D myRB;
Animator myAnim;
bool facingRight

// Use this for initialization
void Start () {
	myRB = GetComponent<Rigidbody2D> ();
	myAnim = GetComponent<Animator> ();

	facingRight = true;


// Update is called once per frame
void FixedUpdate () {
	float move = Input.GetAxis ("Horizontal");
	myAnim.SetFloat ("speed", Mathf.Abs (move));

	myRB.velocity = new Vector2 (move * maxspeed, myRB.velocity.y);

	if (move < 0 && facingRight) {
		flip ();
	} else if (move < 0 && facingRight) {
		flip ();

void flip() {
	facingRight = !facingRight;
	Vector3 theScale = transform.localScale;
	theScale.x *= -1;
	transform.localScale = theScale;


You’re missing a semicolon ( ‘;’ ) at the end of “facingRight”, so the compiler thinks the “void” statement at the start of the “Start” function is continuing on the same line.

you haven’t post the error so this is just a guessing game and my guess is that the below line is the culprit

myAnim.SetFloat ("speed", Mathf.Abs (move));

because SetFloat takes float as argument and you are using Mathf.Abs which returns an int … you can try replacing that line with below line

myAnim.SetFloat ("speed", (float)Mathf.Abs (move));

I’m going to guess perhaps his axis always = 0? As it should look more like.

    float move = Input.GetAxis("Horizontal") * speed;