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 smasgames · Jun 09, 2011 at 05:11 PM · syntax-errorbce0044eof

sript gets error

this is the script:

 object : Transform;
 
 function OnTriggerEnter (other : Collider) {
      if(hit.object) { object.enabled = false; 
      }
 }

script gets this error:

(1,1): BCE0044: expecting EOF, found 'object'.

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 CarlLawl · Jun 09, 2011 at 05:19 PM 0
Share

what are you trying to do? you cant enable/disable objects as far as im aware?

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by terdos · Jun 10, 2011 at 06:42 PM

most likely what you are looking for is something like this:

 object: Transform;
 function OnTriggerEnter(other : Collider) {
  if (other.transform == object) {
   other.gameObject.SetActiveRecursively(false);
  }
 }

this will disable/deactivate whatever object is when it is triggered.

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
0

Answer by Jessy · Jun 09, 2011 at 05:20 PM

You need to use the keyword var at the beginning.

You're also going to have trouble with

 if(hit.object)

That doesn't mean anything.

Comment
Add comment · Show 8 · 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 smasgames · Jun 09, 2011 at 05:23 PM 0
Share

(4,13): BCE0005: $$anonymous$$ identifier: 'hit'.

avatar image Jessy · Jun 09, 2011 at 05:51 PM 0
Share

Like I told you would happen. You'll have to make at effort at writing something that uses defined words. Just because it's syntax-highlighted doesn't mean it does anything. That just means it does something in SO$$anonymous$$E context. There's nothing called hit, and hit.object wouldn't mean anything if there were.

avatar image smasgames · Jun 09, 2011 at 10:45 PM 0
Share

y put fake script on here

avatar image Joshua · Jun 09, 2011 at 10:59 PM 1
Share

o.O you put it on here, he didn't.

avatar image Anxo · Jun 10, 2011 at 06:51 PM 2
Share

lol "why put fake script on here.." omg

Show more comments

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

EOF error message 2 Answers

BCE0044: expecting }, found 'class' alond with BCE0044: expecting EOF, found 'Card' 1 Answer

An EOF Problem :( 1 Answer

FPS Script Error OnCollisonEnter 1 Answer

error help 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