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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

So The Fix To This Error CS1003

Discussion in 'Scripting' started by emoney101skeleton, Jun 22, 2020.

  1. emoney101skeleton

    emoney101skeleton

    Joined:
    Jun 7, 2020
    Posts:
    12
    So One Of The Codes I Wasn't Going To Use, Gave Me This Error
    error CS1003: Syntax error, '(' expected
    Also With This One
    error CS1026: ) expected

    The Code
    using System;
    using StandardAssets.Characters.Common;
    using UnityEngine.InputSystem;

    public class FirstPersonInput : MonoBehaviour
    {
    InputAction StandardAssets.Characters.FirstPerson

    /// <summary>
    /// Implementation of the First Person input
    /// </summary>
    public class FirstPersonInput : CharacterInput
    {
    /// <summary>
    /// Fired when the crouch is started
    /// </summary>
    public event Action crouchStarted;

    /// <summary>
    /// Fired when the crouch is ended
    /// </summary>
    public event Action crouchEnded;

    // Tracks whether the character is crouching or not
    bool m_IsCrouching;

    /// <summary>
    /// Resets the input states
    /// </summary>
    /// <remarks>used by the <see cref="StandardAssets.Characters.FirstPerson.FirstPersonBrain"/> to reset inputs when entering the walking state</remarks>
    public void ResetInputs()
    {
    m_IsCrouching = false;
    isSprinting = false;
    }

    /// <summary>
    /// Handles the sprint input
    /// </summary>
    /// <param name="context">context is required by the performed event</param>
    public override void OnSprint(InputAction.CallbackContext context)
    {
    base.OnSprint(context);
    m_IsCrouching = false;
    }

    /// <summary>
    /// Handles the crouch input
    /// </summary>
    /// <param name="context">context is required by the performed event</param>
    public override void OnCrouch(InputAction.CallbackContext context)
    {
    BroadcastInputAction(ref m_IsCrouching, crouchStarted, crouchEnded);
    isSprinting = false;
    }

    }
    }
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Your errors have line numbers. They will take you directly to the source of the error.
     
  3. emoney101skeleton

    emoney101skeleton

    Joined:
    Jun 7, 2020
    Posts:
    12
    I'm New to Unity The Problem Is 7,54


    Line 7 InputAction StandardAssets.Characters.FirstPerson


    Line 54 isSprinting = false;

    On That Script Thats where the Problem Is and I Don't Know What To Do