Question by
oanto80 · Sep 11, 2016 at 09:01 AM ·
script errorparsing error
(parsing error) can you help me?
hey
I'm new in unity and i make my first game but I got a parsing error on a Csharp script and I can't fix it can you help me?
there is the script:
using UnityEngine;
using System.Collections;
public class movement : MonoBehaviour {
public float moveSpeed;
public float jumpForce;
private Rigidbody2D myRigigdbody;
public bool grounded;
public LayerMask WhatIsGround;
private Collider2D myCollider;
void Start () {
myRigigdbody = GetComponent<Rigidbody2D>();
myCollider = GetComponent<Collider2D>();
}
void Update () {
grounded = Physics2D.IsTouchingLayers(myCollider, WhatIsGround);
myRigigdbody.velocity = new Vector2(moveSpeed, myRigigdbody.velocity.y);
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0))
{
if (grounded)
{
myRigigdbody.velocity = new Vector2(myRigigdbody.velocity.x, jumpForce);
}
}
}
Comment
Answer by srikaran_p · Sep 11, 2016 at 09:31 AM
I guess you are missing one curly braces in the end. There are 4 closed braces and 5 open braces. So just add one more closed curly brace after the end of code and it will be fine.
Your answer
Follow this Question
Related Questions
CS8025 Parsing Error 0 Answers
Question about Version Control Setting 0 Answers
parsing error 1 Answer
How to fix this parsing error? 2 Answers
My gameobject keeps leaving the screen 0 Answers