Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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,890
    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