Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ByronNilsson on May 31, 2012, 10:34:51 AM

Title: Changing Texure
Post by: ByronNilsson on May 31, 2012, 10:34:51 AM
Hi,
Am trying to change a texture/material to match the selection from another GameObject.
I wish to change the texture/material by name 1,2,3.......30,31,32 etc.


I have tried all work arounds, but am stuck.

I could create a large switch table, but this is cumbersome.
Don't really get the 'set material float'
tried 'convert material to object' then 'set object value' but no luck

anybody help

Byron.








 
Title: Re: Changing Texure
Post by: justifun on June 01, 2012, 07:10:23 PM
An easy way would be to be to either use the set material texture action to assign a new shader to the object, or you could have the object have the same textures on both objects and simply change the index of the currently active texture

eg: cube 1 and 2 both have 2 textures on them.....red and green

the first texture is material index _0 (red) and the second texture is material index _1 (green)

so when you click on the first object, it checks which material index is active, then sets cube 2 to have the same index number