- Home /
Question by
thedodgeruk · Nov 02, 2012 at 02:29 PM ·
prefabaddcomponent
prefab as AddComponent?
i have a prefab . and i want to add it like a component
can this be done via script i want to do this sort of thing if possible
GameObject temp = UnityEngine.Resources.LoadAssetAtPath("Assets/Prefabs/MetalCollider.prefab", typeof(GameObject)) as GameObject;
m_collider.AddComponent<temp>();
can this be done ? its for inspetor Editing
Comment
Answer by whydoidoit · Nov 03, 2012 at 11:16 AM
No you can't add a prefab to another object - you can only add scripts.
Your answer

Follow this Question
Related Questions
Adding prefab ParticleSystem to a GameObject? 0 Answers
(Similar Prefabs) vs (Single Prefab + AddComponent) 2 Answers
AddComponent( 1 Answer
Adding Prefab Components 1 Answer