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 Drew 1 · Feb 01, 2011 at 01:17 AM · errorsyntax-errorbce0044uce0001bce0043

3 java errors on a basic shooting script?

I'll start off by saying this: I KNOW NO JAVA SCRIPT. I'm working from this tutorial: http://www.youtube.com/watch?annotation_id=annotation_934937&v=wfpZ7_aFoko&feature=iv[Linky][1] and it calls for a basic script. but as the tittle say, i get three errors on said script. Here's the script:

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

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

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

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

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

    controller.SimpleMove(forward * curSpeed);

    if (Input. GetButtonDown("Jump"));
    {
        var bullit = Instantiate(bullitPrefab,
            GameObject.Find("Fire Spawn").transform.position, Quaternion.identity);
    }
}

@script RequireComponent(CharacterController);

Here are the errors:

Assets/Move Around.js(16,33): BCE0043: Unexpected token: var.

Assets/Move Around.js(16,36): UCE0001: ';' expected. Insert a semicolon at the end.

Assets/Move Around.js(21,9): BCE0044: expecting EOF, found '}'.

the first two seemed strait forward enough, but i tried the obviouse and it didn't seem to work (but again, i don't know java).

Thanks!

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 · Feb 01, 2011 at 02:04 AM 0
Share

It's much easier to read formatted code, even if it means we need to count to the line ourselves. $$anonymous$$y answer should fix the errors for you.

avatar image Drew 1 · Feb 01, 2011 at 02:23 AM 0
Share

Thank you so much $$anonymous$$arowi! That made everything work. and thanks for the tip on the code formatting. i didn't know we could do that!

avatar image · Feb 01, 2011 at 02:37 AM 0
Share

No worries, you just highlight the section you want formatted and press the little button with 0s and 1s. Good luck!

2 Replies

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

Answer by · Feb 01, 2011 at 02:02 AM

Remove the semi-colon after both:

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

and

@script RequireComponent(CharacterController);
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
1

Answer by tertle · Feb 01, 2011 at 01:21 AM

14 if (Input. GetButtonDown("Jump"));

shouldn't have a semicolon after that. what it should look like

if (Input. GetButtonDown("Jump"))
{
//blahblah
}
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 Drew 1 · Feb 01, 2011 at 01:31 AM 0
Share

thx! that seemed to solve all of them except the EOF error.

avatar image · Feb 01, 2011 at 03:09 AM 0
Share

Courtesy upvote, since you nailed the first half.

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

No one has followed this question yet.

Related Questions

SwipeControl package error in unity iPhone 1.7 1 Answer

How can solve these errors in my java script 1 Answer

Unexpected Token: Collider. 1 Answer

help with UCE0001: ';' expected. Insert a semicolon at the end 3 Answers

BCE0044 error: OnControllerColliderHit 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