- Home /
How to pick which component to assign to a base-class variable?
First, some brief background...
I have a trigger/action system, where triggers can invoke actions. I have an abstract base class called Action. Any component deriving from Action can be assigned to a trigger, which will then invoke the action. This system works very well because it allows me to assign any type of action to any type of trigger.
The problem is that some objects have multiple components deriving from Action, and when I try to drag an object with multiple Actions onto a variable of type Action, then the editor seemingly picks the first component deriving from Action, instead of letting me choose which component I actually want to assign.
Any thoughts on how to deal with this problem?
Thanks.
Answer by Walt D · Oct 15, 2010 at 12:32 AM
It turns out that it is possible to open 2 inspector windows on 2 different objects. (Right-click on the inspector tab, go to Add Tab, then Inspector. Click on an object, then click the little lock icon in the corner of the inspector window.)
Simply drag the component from one inspector window to the other!
Your answer
![](https://koobas.hobune.stream/wayback/20220613075708im_/https://answers.unity.com/themes/thub/images/avi.jpg)