Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by BillyMcTreeSnap · Mar 11, 2013 at 03:40 PM · c#errorinternalcs1525

How to fix Script? error CS1525: Unexpected symbol `Internal'

I get Assets/Scriptshas/EnemyAI.cs(29,71): error CS1525: Unexpected symbol `'

 using UnityEngine;
 using System.Collections;
 
 public class EnemyAI : MonoBehaviour {
     public Transform target;
     public int moveSpeed;
     public int roatationSpeed;
     
     private Transform myTransform;
     
     void Awake(){
         myTransform = transform;
     }
     
     // Use this for initialization
     void Start () {
         GameObject go = GameObject.FindGameObjectWithTag("Player");
         
         target = go.transform;
             
     
     }
     
     // Update is called once per frame
     void Update () {
         Debug.DrawLine (target.position, myTransform.position, Color.yellow);
         
         //Look at target
         myTransform.rotation = Quaternion.Slerp(myTransform.r­otation, Quaternion.LookRotation(target­.position - myTransform.position), rotationSpeed * Time.deltaTime);    
     }
 }
 


Problem is between myTransform.rotation = Quaternion.Slerp(myTransform.r­otation, Quaternion.LookRotation(target­.position - myTransform.position), rotationSpeed * Time.deltaTime); Which is line 29 in my script, thank you for your time!

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Mar 11, 2013 at 04:16 PM 1
Share

Can't say from this limited amount of information. Edit the question to include the rest of the script along with the actual error message. And place a comment on the line where the compiler indicates there is an error.

avatar image Landern · Mar 11, 2013 at 04:41 PM 0
Share

Did you mean to mark a variable as internal, but it has a capital I ins$$anonymous$$d of lower case internal?

avatar image BillyMcTreeSnap · Mar 11, 2013 at 05:52 PM 0
Share

I edited.

avatar image Landern · Mar 11, 2013 at 06:04 PM 0
Share

It appears you have some funky characters in your line:29, i would delete the highlighted parts in the image and type them out again, rebuild the scripts and see if that helps.

Funky Characters

funkychars.png (12.4 kB)
avatar image BillyMcTreeSnap · Mar 11, 2013 at 06:56 PM 0
Share

I retyped the line and got 3 new errors.

Assets/Scriptshas/EnemyAI.cs(29,144): error CS0103: The name rotationSpeed' does not exist in the current context Assets/Scriptshas/EnemyAI.cs(29,51): error CS1502: The best overloaded method match for UnityEngine.Quaternion.Slerp(UnityEngine.Quaternion, UnityEngine.Quaternion, float)' has some invalid arguments

Assets/Scriptshas/EnemyAI.cs(29,51): error CS1503: Argument #3' cannot convert object' expression to type `float'

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by robertbu · Mar 11, 2013 at 06:01 PM

If you past your code into an word processor or editor that shows symbols, or you do a hexdump, you will find a symbol between 'target' and '.position' on that line. Hex value is AC, and probably inserted by a word processor. The fix is to delete the line and retype it.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sangar-Zucchi · Aug 31, 2016 at 07:20 PM 0
Share

It worked for me.

The problem was that I copied an line from an PDF file and some special symbols may have come together.

Thank you!

avatar image
0

Answer by Statement · Mar 11, 2013 at 04:31 PM

MSDN: Compiler Error CS1525

Perhaps you named a variable "internal" like this?

 // error CS1525: Unexpected symbol `internal',
 //               expecting `.', `?', `[', `<operator>', or `identifier'
 float internal = 4; 

internal is a reserved keyword. Consider renaming your symbol to something else in such case.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by tataygames · Jul 31, 2019 at 02:17 AM

DAMN, I spend hours, searching for answers, this f*ng copy paste ruin my time. if you copy your code and paste it in other, and copy it back again to your code. this f* error will come up.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fix Script? error cs1525 Unexpected symbol 'vector3' 0 Answers

Semicolons are seen as an unexpected symbol 1 Answer

SetActive() Object reference not set to an instance of an object. 1 Answer

Problem creating GUI.Window, Help please! 1 Answer

C# Errors CS1525,CS8025 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges