Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

I have a Parsing Error, and I need some Help

Discussion in 'Scripting' started by JungleStudios, Jun 15, 2016.

  1. JungleStudios

    JungleStudios

    Joined:
    Jun 15, 2016
    Posts:
    4
    Hey guys, I'm just working on a simple game right now, and I'm sort of new to coding, and came across a Parsing Error for my Melee script
    Here is what my script looks like,

    var TheDamage : int = 50;
    var Distance : float;
    var MaxDistance : float = 1.5;

    function Update ()
    {
    if (input.GetButtonDown("Fire1))
    {
    var hit : RaycastHit;
    if (Physics.Raycast (transform.position, TransformDirection(Vector3.forward), hit))
    {
    Distance = hit.distance;
    if (Distance < MaxDistance)
    {
    hit.transform.SendMessage("ApplyDamage". TheDamage, SendMessage Options.DontRequireReceiver);
    }
    }
    }
    }


    And here if what the Melee Script error says,
    Assets/MeleeSystem.cs(2,15): error CS8025: Parsing error

    I would much appreciate it, if someone gives me a helping hand

    And when I click to see where the error is occurring, it takes me to the top line
     
  2. listener

    listener

    Joined:
    Apr 2, 2012
    Posts:
    179
    if (input.GetButtonDown("Fire1)) <=== Perhaps missing closed quotation mark:)
     
  3. JungleStudios

    JungleStudios

    Joined:
    Jun 15, 2016
    Posts:
    4
    Thanks for the reply, but i just found out that i accidentally was using C# not java script
     
  4. JungleStudios

    JungleStudios

    Joined:
    Jun 15, 2016
    Posts:
    4
    Just asking for some odd reason when i press play on unity, i can look left and right but i can look up and down?