help:Model CubeMap Switching!!!

Hi…
I’m new to this forum and I’ve found it very helpful!
now I have 3 questions!
1-I have 2 scenes and 2 Cubemaps(for shader) for each one! and I want to change Cubemap when I get into every scene(By scripting!)
How Can I do it?
2- I have some models and I want to change it when I press horizontal buttons! how can I change models??
3- I have a model and I want to change the material of it(By scripting!) How can I do it???!:face_with_spiral_eyes:

Thanks very much!!:smile:

I think you’re on the right track with the number of punctuation marks you have, but you could do with a few more exclamation marks, I think. I’m getting the questioning, but not really the excitement.

And in an attempt to also be at least a little helpful, you can just enable/disable child meshes at run time. The material is located at ‘gameObject.renderer.material’.

Use The Scripting Reference and you can search for just about any of those words and find answers.

Unfortunately I have no experience with cubemaps so I’m no help with that one.

thanks…

but I don’t know how to change model and CubeMap yet

I searched for both in reference but I got nothing!

(Note: I Love exclamation marks!!!)

Oh! I’ve looking for results in forum,but I found this post,that is my problem too!
I don’t know what you want, or you solved your questions!?
My question as same as RBM’s question but I’d ask about that more.
At first I’ll completely tell what am I want:
I have 3 different scenes and a model that used in 3 different scenes. Model reflection is important should works correctly in each scenes with reflective variation. So I use a shader that gets cubemap for object reflection and works good.
I created cubemaps of each scenes that I have, But I got a problem. If I want to put the model in a scene and set the scene cubemap, for other scene cube map is one, because the changes in model materials are apply totally! and I just can use one shader material for a model slot material a cubemap!
Now if I want to create different scenes that use a model with different cubemap in each scenes, What should I do? :face_with_spiral_eyes:

My ideas are: ( Possible? )

  • Write a script that changes a cubemap of shder slot material? How to? ( Because I’m not programmer, I just design graphical things in Unity3D ).
    (Ex: scene1.cubemap, scene2.cubemap, scene3.cubemap assign each to a material for owned scene)-Optimized way!

  • I should make a different material files with owned cubemap, and for each scene change materials that have cubemap!?
    ( Ex: model.fbx-> material_scene1.mat, material_scene2.mat, material_scene3.mat )- Hard way!

  • Import models and make them materials for each scene?
    (Ex: model_scene1.fbx, model_scene2.fbx, model_scene3.fbx )-Not good way!

Thanks :slight_smile:

you’ve made it easy to get MHG12.thanks
but does anybody know how to solve this problem??
and also changing model by scripting??

thanks in advance…

No one there to help us?
please!