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 88bueno · Mar 28, 2011 at 06:01 AM · syntax-errorbce0044

custom function syntax error

I know I'll probably feel stupid when someone tells me what I did wrong. I made a custom respawn function to save from the hassle of destroying and intantiating. When I run it, I get the following error:

Assets/weaponSpawn.js(32,10): BCE0044: expecting (, found 'Respawn'.

Any ideas? I have no clue. I know there is NOT supposed to be a "(" in the name of a Function. Here's my code:

var trashCanWeapon: GameObject; /*var target: Transform;*/ var moveSpeed=10; function Update () { transform.LookAt (target.transform); } function Awake(){

pickupActive=true; renderer.enabled=false; transform.Translate(Vector3(Random.Range(30,-30),0,Random.Range(30,-30))); renderer.enabled=true; }

function OnTriggerEnter(){ var weaponID= (Random.Range(1,1)); if (weaponID==1&&pickupActive==true){ Instantiate (creationFlash, transform.position, transform.rotation); Instantiate (creationFlash, transform.position, transform.rotation); renderer.enabled=false; /if (weaponID==1&&pickupActive==true){/ Instantiate(trashCanWeapon, transform.position, transform.rotation); pickupActive=false; Respawn (); /transform.Translate(Vector3.forward*moveSpeed*Time.deltaTime);/

/Transform.LookAt (target.transform);/ /Destroy (gameObject);/ } function Respawn () { transform.position=GameObject.Find("itemSpawnGenerator").transform.position; transform.Translate(Vector3(Random.Range(30,-30),0,Random.Range(30,-30))); renderer.enabled=true; pickupActive=true; }

As usual, any help would be much appreciated. Thanks guys.

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

1 Reply

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

Answer by Eric5h5 · Mar 28, 2011 at 07:08 AM

This is why it's important to format your code properly, and indent where needed. Once you clean it up you'll see where the missing "}" is instantly. See here for some discussion of various indent styles.

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 88bueno · Mar 28, 2011 at 08:03 AM 0
Share

Thanks, this is actually my first foray into any kind of program$$anonymous$$g. Until now, all I did was model for a hobby but I think I found something I really like. Just need practice and less of these stupid mistakes will happen lol. Thanks again.

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

ShopScript.Js(49,17): BCE0044 expecting :, found GUI. 1 Answer

EOF error message 2 Answers

could someone tell me whats wrong with this script? 2 Answers

HELP!! expecting :, found ';' problem 2 Answers

BCE0044: (14,47) expecting :, found ','. makes no sense? 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