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
-1
Question by Masterplayer · Feb 12, 2012 at 08:04 PM · semicolon

Please insert semi colon... WHAT!?!

my computer keeps on saying that i don't have a semi colon at the end of lines 22 and 18

My Scripts Below:

var speed = 24.0;

var rotateSpeed = 3.0;

var bullitPrefab:Transform;

function Update () { var controller : CharacterController = GetComponent(CharacterController);

// Rotate around y - axis;

transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);

// Move forward / backward

var forward = transform.TransformDirection(Vector3.forward);

var curSpeed = speed * Input.GetAxis ("Vertical");

controller.SimpleMove(forward * curSpeed);

if(Input.GetButtonDown("X"));

var bullit:Instiniate (bullitPrefab) GameObject.Find("Spawn Point")transform.position Quaternion.identity;

EOF;

script RequireComponent (CharacterController);EOF }

I don't know the problem PLEASE HELP!!!

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 FTheCloud · Feb 12, 2012 at 08:52 PM 0
Share

please don't ask a duplicate question just because no one answered the first right away.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by aldonaletto · Feb 12, 2012 at 08:28 PM

This error isn't always what it pretends to be: other syntax errors may fool the compiler and produce this error message. The rule is simple: if the line already has a semicolon, the error is something else before the line.
The script above have several errors in the two last lines, which may generate this error:

if(Input.GetButtonDown("X"));
var bullit:Instiniate (bullitPrefab) GameObject.Find("Spawn Point")transform.position Quaternion.identity;    
The right thing should be something like this:

if (Input.GetButtonDown("X")){
    var bullit = Instantiate(bullitPrefab, GameObject.Find("Spawn Point").transform.position, Quaternion.identity);
    // the code to accelerate the "bullit" is missing, but resembles this:
    bullit.rigidbody.velocity = transform.forward * speed;
    Destroy(bullit.gameObject, 2.0); // kill lost bullets after 2 seconds
}
You should check the Tornado Twins worm tutorial more carefully (that's where this came from) because there are more things missing - like the code to accelerate the projectile, for instance.
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 Masterplayer · Feb 13, 2012 at 04:46 AM 0
Share

I've tried your suggestions but it gives another error ... I don't know if it's the scripting program i'm using or what. I am getting very frustrated because i can't test the game out until I figure out the scripting errors. I've tried doing the 'Tornado Twins', but it gives me a error that I can't figure out!!!! If it helps here are what the errors say...

-Assets/NewBehaviorScript.js(19,7): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(19,32): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(19,63): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(19,72): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(19,81): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(19,92): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(21,7): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(21,45): UCE0001: ';' expected. Insert a semicolon at the end. -Assets/NewBehaviorScript.js(21,48): UCE0001: ';' expected. Insert a semicolon at the end.

-All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneVeiw:ShowCompileErrorNotification()

Also, I made some changes to my script...

var speed = 24.0; var rotateSpeed = 3.0; var bullitPrefab:Transform;

function Update () { var controller : CharacterController = GetComponent(CharacterController);

// Rotate around y - axis; transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);

// $$anonymous$$ove forward / backward var forward = transform.TransformDirection(Vector3.forward); var curSpeed = speed Input.GetAxis ("Vertical"); controller.Simple$$anonymous$$ove(forward curSpeed);

if (Input.GetButtonDown("X"))

bullit Instiniate(bullitPrefab) GameObject.Find("Spawn Point")transform position Quaternion identity;

script RequireComponent(CharacterController)EOF } PLEASE ANSWER $$anonymous$$Y PRAYERS!!!!!!: )

avatar image syclamoth · Feb 13, 2012 at 04:49 AM 0
Share

Spelling is terribly important. $$anonymous$$ake sure you spell everything correctly, and that you have all the correct brackets and punctuation. From the looks of things, you need some '=' signs, and some '.' inbetween some of your words- if you can't see the patterns here, you should have a look at some (very) basic scripting tutorials.

Also, isn't TornadoTwins in C#? This looks like JS to me.

avatar image aldonaletto · Feb 13, 2012 at 07:36 PM 1
Share

Well, in my answer I pointed the error and posted the fixed version, but you ignored it! It could seem impossible, but the last lines are even more wrong than before! Take a look at my answer and fix the errors.

avatar image
0

Answer by BiG · Feb 12, 2012 at 08:09 PM

For sure,

if(Input.GetButtonDown("X"));

wasn't your intention. In fact, a semicolon after an if statement will break the statement immediately. Just remove ";" from that line.

Moreover, the next line is a mess ^_^ I don't know what you was trying to do there!

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

8 People are following this question.

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

Related Questions

java script problem 0 Answers

"Insert a semicolon at the end." But there is a semicolon already!! 1 Answer

Another "insert semicolon at end" 1 Answer

Double semi-colons 1 Answer

UCE0001 ";" expected. insert a semicolan at the end? 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