This question was
closed Sep 15, 2016 at 11:29 PM by
Zack148 for the following reason:
I have fixed the issue myself
Question by
Zack148 · Sep 15, 2016 at 11:08 PM ·
c#parsing error
Parsing error and Unexpected Symbol. Help!
using UnityEngine; using System.Collections;
public class PlayerContoller : MonoBehaviour {
public float moveSpeed;
public float jumpForce;
private Rigidbody2D myRigidbody;
public bool grounded;
public LayerMask whatIsGround;
private Collider2D myCollider;
private Animator myAnimator;
// Use this for initialization
void Start () {
myRigidbody = GetComponent<Rigidbody2D> () ;
myCollider = GetComponent<Collider2D> ();
myAnimator = GetComponent<Animator> ();
}
// Update is called once per frame
void Update () {
grounded = Physics2D.IsTouchingLayers (myCollider, whatIsGround);
myRigidbody.velocity = new Vector2(moveSpeed, myRigidbody.velocity.y);
if(Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0))
{
if(grounded)
{
myRigidbody.velocity = new Vector2(myRigidbody.velocity.x, jumpForce);
}
}
myAnimator.SetFloat ("Speed", myRigidbody.velocity.x)
}
Comment
Follow this Question
Related Questions
error cs8025 parsing error? 1 Answer
Need help with this code! 1 Answer
Unity Parsing Error CS8025 on Last Line? 2 Answers
C# Parsing Error 1 Answer