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 daigos · Nov 06, 2014 at 12:54 AM · javascriptobject

Disable GameObject Only Father Not Children

I am using Unity 4 Or a GameObject with a hierarchy Father and son I would like to disable only the Father and Son Get Active I know this in Unity 3 is possible but not unity 4 there must be another method to achieve this also in unity 4 Can someone help me Thanks

Comment
Add comment · Show 3
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 Linus · Nov 06, 2014 at 01:20 AM 0
Share

From where do you want to do it? Dont know any way to do it but not disabling the parents, but ins$$anonymous$$d deactivate componets on them, but leave transforms intact.

Is your hiarchy:

 Father (want to disable)
 Father->Son (want to disable)
 Father->Son->Child (dont disable)
 Father->Son->Child (dont disable)

avatar image awesomeaustin316 · Nov 06, 2014 at 05:18 AM 0
Share

Anytime I'v ever Disabled a Parenting object, the child objects get disabled to

avatar image b1gry4n · Nov 06, 2014 at 07:04 AM 0
Share

Turn off the renderer or other "visible" components for the father object. Turning off the father gameobject will disable all children as well

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by tanoshimi · Nov 06, 2014 at 07:04 AM

As far as I know, what you're asking is impossible. From the Unity 4 release notes, "GameObjects active state will now affect child GameObjects, so setting a GameObject to inactive will now turn the entire sub-hierarchy inactive".

Child gameobjects' behaviour is defined, in part, by the behaviour of their parents, so it doesn't really make sense to have an enabled child of a disabled parent object.

Comment
Add comment · Show 2 · 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 daigos · Nov 07, 2014 at 02:03 AM 0
Share

I had already tried many solutions the problem ' I want to make an animated scene in the game when the player enters the trigger scene is activated so everything is ok but the problem 'this, the player continues to move during the scene, its input, controller, working at the scene and that's not good, the player must remain motionless during the scene must not move or tried several solutions, including: Disable the father by: GameObject.SetActive = false but this also disables the children including and including the $$anonymous$$esh 'Player not visible pause the game, with timescales etc .. But this blocks all The entire game, including the scene make invisible meshes etc. the only method that works a bit rudimentary and 'what disable caracter controller, input controller and all the other scripts that generate the movement of the player Script the GetComponent ......through one by one Script in the Player

At this point I'll have another question If you need to make an animated sequence in your game how do you prevent you from moving to the player?

avatar image AlwaysSunny · Nov 07, 2014 at 02:04 AM 0
Share

See the answer above. You'll need to come up with a different way to organize your object hierarchies, or an approach which does not require the functionality you're seeking.

avatar image
1

Answer by RemiR · Nov 09, 2014 at 08:21 AM

You can detach the children with transform.parent = null

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 toddisarockstar · Nov 16, 2014 at 11:40 PM

create an empty game object in the unity Gameobject dropdown menu at the top. drop both your objects into it so both "real" objects can be treated as seperate children. the empty object still holds em together as a parent.

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

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

gameObject.active Find 1 Answer

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

Setting Scroll View Width GUILayout 1 Answer

JavaScript and Ajax second addition Tutorial 11 case problem 2 0 Answers

Why is my script still running in other scenes? 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