Search Unity

Unexpected Symbol: please help!

Discussion in 'Animation' started by brodan100105, Sep 17, 2016.

  1. brodan100105

    brodan100105

    Joined:
    Jul 16, 2016
    Posts:
    13
    So i am making animations for my 3rd person character for a game I'm making, and i get this;

    Assets/PlayerControls.cs(20,28): error CS1525: Unexpected symbol `Input', expecting `)', `,', `;', `[', or `='

    I am using a new 2016 youtube video to learn how to make animations for my player, and i cant run the game because i have this error, so please help if you can (possibly with picture)

    My Script:

    using UnityEngine;
    using System.Collections;

    public class PlayerControls : MonoBehaviour {

    static Animator anim;
    public float speed = 10.0f;
    public float rotationSpeed = 100.0f;

    // Use this for initialization
    void Start ()
    {
    anim = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update () {

    float translation = Input.GetAxis("Vertical") * speed;
    float rotation Input.GetAxis("Horizontal") * rotationSpeed;
    translation *= Time.deltaTime;
    rotation *= Time.deltaTime;
    transform.Translate(0, 0, translation);
    transform.Rotate(0, rotation, 0);

    if(Input.GetButtonDown("Jump"))
    {
    anim.SetTrigger("jump");
    }

    }
    }

    Thank you!
     
  2. GrischaG

    GrischaG

    Joined:
    Apr 26, 2013
    Posts:
    40
    You lost the =

    float rotation = Input.GetAxis("Horizontal") * rotationSpeed;

    ;)