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 smXP · Jul 30, 2013 at 07:08 PM · javascripterrorfps

BCE0044 expecting ), found 'script' and BCE0043 unexpected token )

I made a simple moving script when these 2 errors came up and it said they were on (6,78) and (6,102) but both end up in the middle of words and when i try to remove ) it come up with more errors can any one please help me? This is the script-

 var walkAcceleration : float = 5;
 var cameraObject : GameObject;
 
 function Update () 
 {
     transform.rotation = Quaternion.Euler(cameraObject.GetComponent(look script).currentYRotation);
     rigidbody.AddReletiveForce(Input.GetAxis("horizontel") * walkAcceleration, 0, Input.GetAxis("vertical")* walkAcceleration);
 }    
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by bompi88 · Jul 30, 2013 at 07:45 PM

It's inside your GetComponent. Wrap the name of your script inside "", like:

 cameraObject.GetComponent("MyScript")
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 Lovrenc · Jul 30, 2013 at 07:49 PM 0
Share

Im gonna have to oppose this (and is not what his problem is anyways).

Directly from documentation: It is better to use GetComponent with a Type ins$$anonymous$$d of a string for performance reasons. Sometimes you might not be able to get to the type however, for example when trying to access a C# script from Javascript. In that case you can simply access the component by name ins$$anonymous$$d of type.

avatar image smXP · Jul 30, 2013 at 07:51 PM 0
Share

it now come up with UnityException: Input Axis horizontel is not setup. To change the input settings use: Edit -> Project Settings -> Input player movement.Update () (at Assets/player movement.js:7)

avatar image Lovrenc · Jul 30, 2013 at 07:52 PM 0
Share

You see, exception even tells you EVERYTHING you need to fix. Try it.

Answer: It is Horizontal not horizontel. Capitalization is important aswell.

Hint: vertical will also be a problem.

avatar image
0

Answer by Lovrenc · Jul 30, 2013 at 07:46 PM

I dont want to give you the answer directly, but here is your problem:

 GetComponent(look script)


Aditional hint, focus on script name.

Comment
Add comment · Show 5 · 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 smXP · Jul 30, 2013 at 07:59 PM 0
Share

is it the space because capitals are all right or do i have to change the name in my project floder

avatar image Lovrenc · Jul 30, 2013 at 08:03 PM 0
Share

Yes, spaces are not alowed in a name. Compiler cannot know what goes together if there is a space.

some convetions:

  1. lookScript

  2. look_script

I see youre using camel notation in variables names. So i suggest you rename your script to lookScript.

avatar image smXP · Jul 30, 2013 at 08:08 PM 0
Share

now come up with referenced script on this behavior is missing and it also come up with InvalidCastException: Cannot cast from source type to destination type. playermovement.Update () (at Assets/playermovement.js:6)

avatar image perchik · Jul 30, 2013 at 08:30 PM 0
Share

This is because you are trying to use Quaternion.Euler() which takes in a Vector3 or 3 floats, and you only give it something called "currentYRotatation" which is probably not a Vector3

avatar image Lovrenc · Jul 30, 2013 at 08:34 PM 0
Share

Referenced script is missing...

You dont have a script you are trying to access... You need to go back to basics man.

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

18 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

Related Questions

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

Basic scripting help (FPS Tutorial) 1 Answer

BCE0049 error with networking script 0 Answers

Semi colon placement? unity error message 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