Same component on multiple objects

Sorry for posting this, maybe it has been answered before, but could not find it…

How do I assign the same component on different objects?

Do I have to do it trough prefab? In this case do I have to create an empty object?

Thanks

If you have a list of the objects, you could iterate through them and use the gameObject.addComponent method. If you are making objects as you go, you could just addComponent as you make them.

It is rather the first case
Does this means that I have to script it myself?

Yes, of course, there is no way Unity could possibly know which gameobjects need which components unless you tell it. You can easily search with gameObject.FindGameObjectsWithTag for tag-based searches or Object.FindObjectsOfType for component-based searches.

Thanks JRavey, I will give it a go…
…for some reasons I thought one could just drag a component from one object to another, it would be nice if it was implemented.

p.s. I was looking at your puzzle game, it looks quite interesting and similar to something I am trying to achieve, have you got any advice on this?
http://forum.unity3d.com/threads/70121-Simple-3d-Puzzle-Game

If you have a design doc or prototype I would be happy to look at it and help you here and there with design and planning your application.

Will reply here on the topic of the 3d puzzle, thanks.

I am really unsure if there is a way to speed up this process:
Basically a rarely create objects in Unity because usually I do all my models with other 3d modelling software, then I import into Unity and apply the interactivity.
The issue I don’t really understand is this: in my scene I have some objects which are the same, the must have the same components but they are positioned in different locations(such as columns with rigidbody etc…). Now if I use Object.FindGameObjectsWithTag or Object.FindObjectsOfType it is still quite slow in order to apply the same component over and over again.
I though about doing a prefab for an object but that would mean to re-modelling/positioning all my objects again in Unity

Is there a solution for this?
Thanks

p.s. The issue is not only this, it is also that I would really like to have a workflow where I have some templates objects that I can reuse but the positiong is done outside unity