how to change to another object after button is pressed

if (GUILayout.Button(“Red”)) {
i do not know what to write here
}

I imported 3D object called abc1 from Maya, by default is using lambert3 (blue color).

if i want to replace it with another 3D object called abc2, which is using lambert1 (red).

or is it possible to replace abc1 directly with lambert1? since already imported into unity3d as well even without import abc2.

i am doing for android + Augmented reality (vuforia) + unity3d.

thanks!

1 Answer

1

There are any number of things you can do depending on the structure of your project and what you are trying to accomplish. My guess as to the two most likely are to change the color or change the texture of the material. Both can be done by script.

Renderer.material.color

or

Renderer.material.mainTexture

yea.. i asked after i tried. thank u so much by the way =) i solved it by using virtual button at last

–