playMaker

Author Topic: Changing Texure  (Read 2362 times)

ByronNilsson

  • Playmaker Newbie
  • *
  • Posts: 18
Changing Texure
« 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.








 

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Changing Texure
« Reply #1 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