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 CoopYears · Sep 04, 2012 at 02:43 PM · errorbeginnersunexpected token

Very new to scripting: Apparently I have a unexpected token?

So I have an unexpected token of a ; at the end of a var, so I removed it, than it said it was an expected token... I am completely new to all this, and all the scripting i've been doing has been following a tutorial, so if it was all completely wrong I wouldn't know. Can someone please tell me how to fix this, as I only just found out what an unexpected token was, let alone how to do all this. What have i done wrong? Thanks everyone. Plus any beginners tips would be nice!

 var forwardSpeed : float = 3;    
 var turnspeed : float = 2;
 
 
 Function; Update ();
 - {
 
 //this is the forward speed that will happen in the game
 };var; forwardMoveAmount: Input.GetAxis("Vertical")*forwardSpeed;
 
 var turnAmount = Input.GetAxis("Horizontal")*turnSpeed;
 
 transform.Rotate(0,turnAmount,0); 
 }
Comment
Add comment · Show 1
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 AlucardJay · Sep 04, 2012 at 03:11 PM 0
Share

Some beginner help as you asked. The unity3dstudent 'site has some 5-$$anonymous$$ute videos that explain alot of things with scripting and components. The last 2 links are for more tutorials =]

Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/essential-skills/

Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/beginner/

the Unity Wiki : http://wiki.unity3d.com/index.php/Tutorials

A list of resources : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by PProductions · Sep 04, 2012 at 02:56 PM

Here is what the script should look like based on my knowledge:

 var forwardSpeed : float = 3;   
 var turnspeed : float = 2;
 
 
 function Update () {
 
 //this is the forward speed that will happen in the game
 var forwardMoveAmount = Input.GetAxis("Vertical")*forwardSpeed;
 
 var turnAmount = Input.GetAxis("Horizontal")*turnSpeed;
 
 transform.Rotate(0,turnAmount,0); 
 }
Comment
Add comment · Show 3 · 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 CoopYears · Sep 09, 2012 at 03:20 AM 0
Share

Hi, thanks for the tips alucardj, and PProductions, thanks i made the changes neccesary to look like the script you gave me, and that took away the unexpected tokens, but now I have turnspeed as an unknown identifier. Any idea how i can fix it? Thanks.

avatar image Eric5h5 · Sep 09, 2012 at 03:45 AM 0
Share

Pay attention to spelling/capitalization, it's extremely important in coding.

avatar image CoopYears · Sep 09, 2012 at 04:11 AM 0
Share

Eric5h5 thank you so much! It was the capital S in speed, and after i changed it, the error disappeared. Thanks!

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

10 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

Related Questions

Multiple Cars not working 1 Answer

Unity error "scripts exist in multiple locations" 1 Answer

Help Solve This 2 Answers

my script says OnCollisionEnter() error bce005 and it wont work 3 Answers

Spawn Script Issue 0 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