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 TheRichardGamer · Apr 28, 2013 at 11:53 AM · gamelightvariables

Error BCE0077

So I am doing a flashlight for my game, and I want the feature to toggle the light on and off. But I get Error BCE0077 : It is not possible to invoke a expression of type 'boolean'. My question is: what is wrong with my script? Have I done something wrong here?

Here's my script :

 var LightObj : GameObject;
 var Status = true;
 
 
 function Update () {
 
 if(Input.GetKeyDown("f")){
 if(Status == true){
  Status == false();
 }
 
 else
 
 if(Status == false){
 Status == true();
 
 }
 
 }
 
 
 
 
 
 
 }
 
 function CheckStatus () {
 
 if(Status == true){
 LightObj.Light.enabled = true;
 
 }
 
 else
 
 if(Status == false){
 LightObj.Light.enabled = false;
 
 }
 
 
 }

 
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 Keith1024 · Apr 28, 2013 at 06:31 PM 0
Share

Did my answers help at all? Note, it's considered common courtesy to vote up a helpful answer, and/or mark an answer as the answer if you asked the question.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Keith1024 · Apr 28, 2013 at 12:06 PM

You are attempting to call false as if it were a function.

Just remove the parenthesis on line 9 and 15. You are also performing a conditional check in those lines rather than assignment. So you may want to fix that too. ;)

Keith

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 TheRichardGamer · Apr 28, 2013 at 12:24 PM 0
Share

Ok, so how do I fix the assignment thing?

avatar image Keith1024 · Apr 28, 2013 at 01:03 PM 0
Share

Well, a conditional check is performed by ==, in this case the check is for equality. An assignment is performed by =, which assigns the operand to the right of the =, to the operand on the left. So just change the == to = in lines 9 and 15.

avatar image asafsitner · Apr 28, 2013 at 01:06 PM 0
Share

false is a value, like 4 is a value. So just as you can write X = 4 you can write Status = false;

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

14 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

Related Questions

Error... that I don't understand. 3 Answers

How to link this 2 variables from 2 different scripts / gameobjects? 1 Answer

How to change public variable by another script 0 Answers

lighting click help 3 Answers

error with footsteps script 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