Follow

What is CS1525?

Symptoms

  • You are seeing the following error in the console window:
error CS1525: Unexpected symbol `____', expecting `____'

Cause

This is caused when an invalid character is found in an expression. For example, the if statement below does not allow the symbol "a" to appear after "if" in the if statement.

Error this example presents:

error CS1525: Unexpected symbol `a', expecting `('

Resolution

Ensure that the correct symbols appear within the expression. In this example we have placed a "(" symbol after the if statement as this was missing and flagging the "a" as a invalid symbol.

More Information

https://msdn.microsoft.com/en-us/library/3hdyz4dw(v=vs.90).aspx

 

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Dhruv Dubey
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class PlayerMovement : MonoBehaviour {

        // This is a reference to the Rigidbody component called "rb"
        public Rigidbody rb;

        public float forwardForce = 2000f;  // Variable that determines the forward force
        public float sidewaysForce = 500f;  // Variable that determines the sideways force
        //public float upwardForce = 200f;

        // We marked this as "Fixed"Update because we
        // are using it to mess with physics.
        void FixedUpdate ()
        {
            // Add a forward force
            rb.AddForce(0, 0, forwardForce * Time.deltaTime);
            public void turnRight ()
            {
                rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            }
            public void turnLeft ()
            {
                rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            }

            
            if (rb.position.y < -1f )
            {
                FindObjectOfType<GameManager>().EndGame();
            }
        }
    }
     
     
     
     
     
     
    this the code that i am using and it is giving me 15 errors what do I do
  • 0
    Avatar
    Jarvis

    Hello there,

    Thank you for your comment. Sorry to see you are having some scripting errors here. Sadly, I cannot advise on technical issues here, however we do have support forums which may help you resolve this!

    Please visit our Scripting forum here: https://forum.unity.com/forums/scripting.12/

    If you search in the forums for the subject or error you are getting, or create a post of your own, I am confident that you will find the answer you are looking for.

    Thanks!

    Edited by Jarvis
Please sign in to leave a comment.