playMaker

Author Topic: How do you change materials-element0?  (Read 3578 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
How do you change materials-element0?
« on: April 02, 2015, 09:38:05 PM »
I have a flag waving in the wind using unity 5 (really cool).  Under the 'skinned mesh renderer', there is 'materials' and in 'element 0' there is the 'pirat4' graphic.  How do I change it to another material?

Using 'set material' I can't find it.  I know it's there but not sure what's the crazy name it is given.  Thanks


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do you change materials-element0?
« Reply #1 on: April 03, 2015, 02:17:48 AM »
Hi,

 first you are not using set property properly, you need to drag the component itself, not the gameobject.


Then you have an action "Set Material" that will do just that, have you tried tit already?

 Bye,

 Jean


wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do you change materials-element0?
« Reply #2 on: April 03, 2015, 01:21:24 PM »
OK, so you got that right.  I was trying to use the game object and not the component.  SO now I can change textures.


HOWEVER,  my next issue is how do I change it from a prefab?  I can change the prefab's texture (the flag) but then the prefab is also change.  SO I want to change the texture on a CLONE in the hierarchy.

HOWEVER, the clone is now referenced by a variable.  How would I change the texture of the CLONE?

One way is just to change the prefab's texture and then instantiate a object.  I could do this every time I create an object.  However, is there a better way?  I want to be able to change the texture of a clone in the hierarchy that's game object is a variable.