Trying to set the maxspeed for the player but get this error
Assets/scripts/Player.cs(31,9): error CS1525: Unexpected symbol `}’
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public float maxSpeed= 3f;
public float speed = 50f;
public float jumpPower = 200f;
public bool grounded;
private Rigidbody2D rb2d;
private Animator anim;
void Start ()
{
rb2d = gameObject.GetComponent<Rigidbody2D> ();
anim = gameObject.GetComponent<Animator> ();
}
void Update ()
{
anim.SetBool ("Grounded", grounded);
anim.SetFloat ("Speed",Mathf.Abs (Input.GetAxis("Horizontal")))
}
void FixedUpdate(){
float h = Input.GetAxis ("Horizontal");
rb2d.AddForce((Vector2.right * speed) * h);
if (rb2d.velocity.x > maxSpeed)
{
rb2d.velocity = new Vector2 (maxSpeed, rb2d.velocity.y);
}
if (rb2d.velocity.x < -maxSpeed)
rb2d.velocity = new Vector2 (-maxSpeed, rb2d.velocity.y);
}
}