Hi,
I'm trying to create GUITextures on the fly but I keep on getting this error ->
"Can't add component 'GUITexture' to something different because such a component is already added to the game obejct!"
Here is an example of test code what I'm trying to accomplish
GUITexture textureTest1 = gameObject.AddComponent<GUITexture>() as GUITexture;
GUITexture textureTest2 = gameObject.AddComponent<GUITexture>() as GUITexture;
the error appears when gameObject adds a component the second time.
I don't really understand because you can attach many GUITextures components through the editor?
I would really appreciate if some one could possibly explain to me why this does not work.
Kind Regards