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 RazorShockGames · Sep 10, 2012 at 07:15 PM · javascripterrorsyntax

Script error with turrets

 var LookAtTarget:Transform;
 var damp = 6.0;
 
 function Update () 
 {
 if(LookAtTarget)
 {
 var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position);
 
 transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.deltaTime * damp);
 {
 //transform.LookAt(LookAtTarget);
 }

The error: Assets/TurretBehaviour.js(13,2): UCE0001: ';' expected. Insert a semicolon at the end.

Comment
Add comment · Show 2
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 Jessespike · Sep 10, 2012 at 07:33 PM 0
Share

Hard to help when your code isn't formatted or complete.. The error says you are missing a semicolon... $$anonymous$$aybe you are, can't tell with snippet you provided. Is there more code? If not, where are your closing curly brackets? "}"

avatar image flaviusxvii · Sep 10, 2012 at 09:29 PM 0
Share

I reformatted your code and changed the tags. The code had odd escape characters in it, so please be sure you are pasting plain text in your submission. Also select the code and hit the little "binary" button to have it get marked up as code. The reformatted code looks like it has a stray opening brace.

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by RazorShockGames · Sep 10, 2012 at 09:08 PM

Okay lemme code it again and send you it in proper format

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 RazorShockGames · Sep 10, 2012 at 09:08 PM

The code I used is here: http://youtu.be/cyXV3dUU30w?t=5m8s

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 Ranger-Ori · Sep 10, 2012 at 07:56 PM

Well it seems you are new to programming at all as you fail to realize what's the error you encountered. (And this is the most common and basic error there is)

I suggest you go back to learning the basics of programming, whether it's C#/C++/Javascript or Java. There are plenty of tutorials over the internet. Good Luck!

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 Jessespike · Sep 10, 2012 at 09:12 PM 0
Share

Ins$$anonymous$$d of being a snob about it, why don't you be helpful? This isn't even an answer so why did you reply as such? And the error is misleading, it mentions a missing semicolon, in reality, it's because of missing curly braces.

I suggest you go back to learning the basics of etiquette, whether it's in writing or in speech, There are plenty of tutorials over the internet, Good luck!

avatar image Ranger-Ori · Sep 10, 2012 at 09:23 PM 0
Share

So Jesse, did you find what the problem was? Cause I don't have a clue. Oh wait, he did post his problem, he actually copied it, and posted it with his question, so stop being such a prig.

avatar image
0

Answer by RazorShockGames · Sep 10, 2012 at 09:08 PM

Why is your comment coming though and not mine?

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 Jessespike · Sep 10, 2012 at 09:15 PM

The error is misleading, you need closing curly braces.

 public var LookAtTarget:Transform; 
 var damp = 6.0;
 
 function Update () 
 { 
     if(LookAtTarget) 
     { 
         var rotate = Quaternion.LookRotation(LookAtTarget.position - transform.position); 
         transform.rotation = Quaternion.Slerp(transform.rotation, rotate, Time.deltaTime * damp); 
     }
     //{
     //    transform.LookAt(LookAtTarget);
     //}
 }
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

11 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

Related Questions

Simple syntax error that I can't seem to find 2 Answers

Syntax errors? 2 Answers

Javascript syntax errors with basic expressions 2 Answers

Script is causing immense lag, and I don't know what's causing it. 2 Answers

Very odd but harmless error? *Not that urgent* 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