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 Topthink · Nov 24, 2016 at 09:15 PM · objectcomponentactivesyntax

How Do I deActivate One Sphere ?

I have three Spheres in a scene. I want two to be active and one to be deactive...I want the Sphere to remain visible in the scene but I just don't want it to do anything...I want to just turn it off so it sits there and does nothing. But I can't quite figure out how to do it? Maybe I have the syntax wrong? Or maybe it's something else. I have --

Sphere (1)

Sphere (2)

Sphere (3)

I've tried all sorts of stuff like Sphere(1).SetActive(false); I've used GameObject and gameObject and included and () and all sorts of combinations of these but I just can't quite get the right command. Maybe it can't be done...but my guess is that I just don't know what I'm doing.

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

Answer by Nova-1504 · Nov 24, 2016 at 09:26 PM

Use the Destroy.component function. It's simple and does exactly what you're describing.

Comment
Add comment · Show 4 · 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 Nova-1504 · Nov 24, 2016 at 09:29 PM 0
Share

Check out this link

avatar image Topthink Nova-1504 · Nov 24, 2016 at 09:41 PM 0
Share

Thank you. That does about the same thing as gameObject.SetActive(false); in that the objects will disappear from the scene if I have the script attached to the object. But it always gets rid of the object that the script is attached to.

I'd like to be able to select the item that I want to disable/inactivate and even change it from scene to scene and I would like for it to remain visible. I don't know how to selectively disable one of the spheres.

I appreciate you taking the time to help me but it's not exactly what I'm looking for. I'm sorry that I wasn't clear.

avatar image Topthink Nova-1504 · Nov 24, 2016 at 10:02 PM 0
Share

Not really a comment, but I'm going through those beginner and intermediate tutorials that you referred to. That's what prompted the question. After seeing one of the later tutorials, it was something that I thought would be useful in one of my programs but I couldn't quite figure out how to do it.

I've already gone through the beginner tutorials previously but at that time I was a total 100% Unity noob and I didn't understand most of what I watched.

The "beginning" stuff is a lot clearer this time but I can tell I still have a long ways to go to really understand Unity.

avatar image Topthink · Nov 24, 2016 at 10:13 PM 0
Share

Thanks. I have to watch these tutorials more than once. Some of you guys might have to watch them only once. I'm an old guy and I'm not that fast. I must watch them (after which most of it is still confusing) and them do some stuff and watch them again and them watch some other tutorials and so some stuff and then I STILL must often go back and watch them again.

Some of those tutorials, I've watched three or four times already. And I'll probably still need to watch some of them again.

I'm slow I suppose. :)

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

61 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

SetActive won't work 3 Answers

Enquiry on what are the maximum number of components for a specific object in Unity 0 Answers

Random time activate/deactivate object 1 Answer

How to my objects randomly active? 1 Answer

How to set GameObject's component to an instance of an object 0 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