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 rustofelees · Jun 30, 2016 at 11:32 PM · editorselectionsceneview

How to select prefab children in scene view

Hello,

I've been reading up on SelectionBase Attribute and how all prefabs have this so that you select the prefab root when selecting any of it's children. While this is handy in a lot of cases, it's downright annoying when trying to select individual objects that are a part of the prefab. Often times, I'll need to click 2 or 3 times to select the appropriate game object.

My question is this: is there a way to disable(even temporarily) this functionality in unity so that when I select an object, it selects the expected object rather than the root prefab object? I'd prefer to not have to add the selection base attribute to every object in the scene in order for them to be selected with a single click.

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 rustofelees · Jul 01, 2016 at 09:26 AM 0
Share

Bump. Anyone?

avatar image Baste · Jul 01, 2016 at 10:44 AM 0
Share

Not really. You have very little control over what clicking in the scene does. There's the [SelectionBase] attribute... and that's about it.

What you can do is to write scripts that run in the editor which selects based on other parameters. You'll need to have a static editor script set to [InitializeOnLoad], and a static constructor that hooks up an event to the SceneView.onSceneGUIDelegate event.

Then in that event, you can use Event.current.mousePosition to figure out what you're mousing over, and set that as Selection.activeObject.

It's cumbersome, but fairly powerful. We're using this to have the mouse wheel scroll through all objects we're mousing over, which is the most useful feature. Good luck, and feel free to ask questions.

avatar image rustofelees · Jul 05, 2016 at 08:06 PM 0
Share

Baste - interesting idea!

2 questions:

I often use the mouse wheel to zoom in and out the scene view. Being that you're using this for cycling through objects, how do you and your $$anonymous$$m zoom in and out?

Secondly, you mentioned that you're Selection.active equal to the object that you're mousing over [which i believe is a single game object]. If you're doing this, how are you deter$$anonymous$$ing ALL of the objects that the mouse is currently over. Is there an additional raycast, etc that happens so you can get all of them?

Thanks for your input - I've found it difficult to get feedback on this topic!

Rusty

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by GardenfiendGames · Feb 22, 2021 at 10:42 PM

If you have a similar situation like me, where you have nested prefabs and don't want to select the root-prefab, it may be helpful to know that you can Alt+Click the "pickability" (the hand/finger icon to the left of gameobjects in the Hierarchy) to make ONLY that gameobject un-selectable and not its children. I use a prefab container for all environment gameobjects in my scene, and just learned about this Alt+Click, which fixed the issue of me clicking on any environment gameobject in Scene View and it selecting the root prefab container.

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

52 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

Related Questions

Unable to select anything on the Scene window by clicking 2 Answers

Auto-Selecting something else in Scene-View? 0 Answers

How can I set a selection-sphere in the editor 1 Answer

Selecting objects in scene view with left mouse button always selects child object. 1 Answer

Unity Editor style selection in game 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