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 /
  • Help Room /
avatar image
13
Question by sarahnorthway · Aug 21, 2016 at 11:43 PM · inspector

How to drag a specific component reference from one object's Inspector view to another one?

I have a GameObject with two copies of the same component: an "on" Tween and an "off" Tween. I also have a TweenHandler component with two variables: onTween and offTween. If all three components are on the same GameObject, I can open the Inspector view and use my mouse to drag the "on" Tween up to the onTween slot in TweenHandler, and the "off" Tween up to the offTween slot. Everything works perfectly.

But if the TweenHandler component is on a different GameObject, how do I drag the "off" Tween reference over to the offTween slot on the other object? How do I switch the inspector window to the 2nd GameObject?

Assume I can't touch the code. I just want to know if this is possible using drag & drop.

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 Harinezumi · Mar 30, 2017 at 10:43 AM 0
Share

I didn't even know you could drag the component itself, I always dragged the whole object. This will be soooo useful :)

1 Reply

· Add your reply
  • Sort: 
avatar image
22
Best Answer

Answer by sarahnorthway · Aug 22, 2016 at 12:06 AM

Ahah! That was fast. I didn't realize you could have multiple inspector windows open.

Right-click the Inspector title and pick "Open Tab". Navigate to object #1 in one Inspector then click the little lock icon at the top-right of the Inspector view. Navigate to object #2 in the other Inspector, and drag the "off" Tween over.

Comment
Add comment · Show 1 · 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 huulong · Oct 19, 2016 at 12:51 PM 1
Share

This is also what I am doing. The editor will always pick the 1st component that matches the field type you need from top to bottom, so you can predict which component will be selected when dragging a game object to a component inspector field. However, moving components up and down is tedious so it is hard to exploit to drag one component and then another one.

I wish you had the option to see all components that match the field type when clicking on the small circle on the right of the inspector field. This would show multiple components on the same game object, in the format "GameObject (Component X)" where X is the number of the component if there are multiple components of the same type on the game object. In general, I use multiple components that derive from the same base class, but have different subclasses, so just having "GameObject (Component)" ins$$anonymous$$d of just "GameObject" in the inspector field "circle" selection menu would help me a lot already. Does anybody know a Unity plugin for that?

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

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

Related Questions

Preprocessor conditional code for cleaner inspector options 1 Answer

Creating game objects from inspector 0 Answers

How do I bind the value of a public variable from the inspector to some other variable/constant? 0 Answers

public bool not showing in inspector 1 Answer

I have assigned it, but I get an error of Unassigned Reference Exception! 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