Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 yoyohacks991 · Jul 30, 2015 at 06:33 PM · uce0001

error: ';' expected. Insert a semicolon at the end.

every time I import a script this message pops out error: ';' expected. Insert a semicolon at the end.so I just wanna know what is wrong with my script here it is and if there is anything wrong pls inform me

 #pragma strict
 
 var rayLength = 10;
 
 private var treeScript : TreeController;
 
 private var playerAnim : Arms Controller;
 
 function Update()
 {
     var hit : RaycastHit;
     var fwd = transform.TransformDirection(Vector3.forward);
     
     if(Physics.Raycast(transform.position, fwd, hit, rayLength))
     {
         if(hit.collider.gameObject.tag == "Tree")
         {
             treeScript = GameObject.Find(hit.collider.gameObject.name).GetComponent(TreeController);
             playerAnim = GameObject.Find("FPSArms_Axe@Idle").GetComponent(PlayerControl);
             
             if(Input.GetButtonDown("Fire1") && playerAnim.canSwing == true)
             {
                 treeScript.treeHealth -= 1;
             }
         }
     }
 }

Comment
Add comment · Show 3
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 Graham-Dunnett ♦♦ · Jul 30, 2015 at 06:37 PM 0
Share

Oh, and I formatted your script for you.

avatar image AlwaysSunny · Jul 30, 2015 at 08:02 PM 1
Share

Not for nothin, but syntax errors like Unexpected Characters and Parsing Errors are not supposed to pass moderation AFAI$$anonymous$$. Usually I refer them to FAQ, glance them over, answer if I spot the problem, then reject it.

avatar image Vedal987 · Jul 30, 2015 at 08:14 PM 0
Share

This isn't an answer but hey fellow SpeedTutor buddy, I had a problem with this script before but not the same one, also what line does the error say it's on?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Graham-Dunnett · Jul 30, 2015 at 06:36 PM

You are ignoring the line which the compiler has the error. I assume it says line 7. Which should make you spot that the variable type has a space in it. The compiler assumes that the space is the end of the statement and so needs a semicolon.

(Also, note that it's expected for Unity users to include full details about their problems on this site. You are avoiding including the error number, UCE0001 which I have added for you. Also, when you need help, just search for these errors and you'll get lots of help and not need to post a duplicate question.)

Comment
Add comment · Show 2 · 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 yoyohacks991 · Jul 30, 2015 at 07:59 PM 0
Share

thanks so much for replying so fast but if I removed the space I get this error The name 'ArmsController' does not denote a valid type ('not found'). if u can maybe it would be better if u just edited it for me and placed it here so I can copy it and sry for bothering u

avatar image Cherno · Jul 30, 2015 at 08:11 PM 0
Share

Check the "Arm Controller" class name as well as the file name if it is a $$anonymous$$onoBehaviour script. All should be ArmController, without spaces.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Collision Detector script 1 Answer

Problem with my Hack and Slash tutorial Health bar script 1 Answer

BCE0044 error 0 Answers

Scripting Error when drawing texture to custom window; What am I doing wrong? 1 Answer

Three errors in my project, PLEASE HELP! 1 Answer


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