Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 PowerWm · Jul 18, 2017 at 05:04 PM · scripting problemerror message

UCE0001 semicolon expected

Since I'm relatively new to coding, this may seem like a trivial issue to you all. It says that on line 15 a semicolon is expected. I already have a semicolon so I think it's an issue with the rest of the code. Can someone help, please?

 #pragma strict
 var rotationSpeed = 75;
 
 var jumpHeight = 10.5;
 function Update () 
 
 //first lines!
 
 {var rotation : float = Input.GetAxis ("Horizontal")*rotationSpeed;
 
 rotation *= Time.deltaTime;
 
 GetComponent.<Rigidbody>().AddRelativeTorque (Vector3.forward*rotation);
 
 if (Input.GetKeyDown(KeyCode.W)) IsFalling = false;
 {
 
 GetComponent.<Rigidbody>()velocity.y = jumpHeight;
 
 IsFalling = true;
  }
 
 }
 
 function OnCollisionEnter()
 {
 {IsFalling=false;
  }
 
 }
freshpic.jpg (38.8 kB)
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 PowerWm · Jul 18, 2017 at 05:04 PM 0
Share

The issue is on the get component line with the velocity

avatar image Dave-Carlile · Jul 18, 2017 at 05:50 PM 0
Share

Please edit your question and format your code properly using the "101010" button.

avatar image rageingnonsense Dave-Carlile · Jul 18, 2017 at 07:22 PM 0
Share

I dunno if it is just me, but none of the buttons of graphics in the editor anymore. maybe a firefox bug.

avatar image tanoshimi · Jul 18, 2017 at 06:48 PM 0
Share

Please format your code correctly. Currently, it's impossible to tell what line 15 is, and your use of {curly brackets} is also a bit bizarre.

avatar image WideEyeNow · Jul 18, 2017 at 06:56 PM 1
Share

I have the same Issue of the buttons not showing. if you slowly take your mouse along where the buttons should be, they will give info text of what they are. Code snippet should be between the first 2 lines, say 4-5 buttons in

avatar image Bunny83 WideEyeNow · Jul 18, 2017 at 11:02 PM 0
Share

Right, the buttons image is suddenly missing on the unity server. It's like that for several days now. I was about to write a bug report about that. It's basically the "wmd buttons" image that is missing on UA. The link i provided is from stackoverflow.

UnityAnswer is trying to load this image from here but as you can see, the image is somehow missing.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Jul 18, 2017 at 11:17 PM

You're missing a dot after you get the Rigidbody component.

 GetComponent.<Rigidbody>()velocity.y = jumpHeight;

this line should be:

 GetComponent.<Rigidbody>().velocity.y = jumpHeight;

Note the dot between "()" and "velocity".

You really shoud format your code in a consistent way. i.e.:

 #pragma strict
 var rotationSpeed = 75;
 var jumpHeight = 10.5;
 
 function Update () 
 {
     var rotation : float = Input.GetAxis ("Horizontal")*rotationSpeed;
     rotation *= Time.deltaTime;
     GetComponent.<Rigidbody>().AddRelativeTorque (Vector3.forward*rotation);
     
     if (Input.GetKeyDown(KeyCode.W))
         IsFalling = false;
     GetComponent.<Rigidbody>().velocity.y = jumpHeight;
     IsFalling = true;
 }
 
 function OnCollisionEnter()
 {
     IsFalling=false;
 }

This is what your code looks like when formatted properly. However the whole GetKeyDown thing seems to be non-sense. It's not clear what you wanted to do here.

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 PowerWm · Jul 19, 2017 at 12:15 AM 0
Share

Thank you so much. Also the get key down thing is for pressing the ''W'' resulting in a jump. Problem Solved!

avatar image
0

Answer by WideEyeNow · Jul 18, 2017 at 10:41 PM

I'm not familiar with javaScript, but does that period belong after GetComponent? And shouldn't still, jumpHeight be declared first? jumpHeight = GetComponent??

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

110 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

C# script editor won't open? What should I do 2 Answers

A get or set accessor expected 1 Answer

Cant fetch components from GameObjects stored in an array? 0 Answers

unity missing reference exception the object of type transform has been destroyed but you are still trynig to access it 0 Answers

Unloading Broken Assembly | How to solve this !? 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