Playmaker Forum

PlayMaker Help & Tips => Android Help => Topic started by: cursed1 on December 03, 2013, 04:04:26 AM

Title: Material name?[SOLVED]
Post by: cursed1 on December 03, 2013, 04:04:26 AM
i have four numbers textures/material and four cube
 set random material cube fsm
but i don't know  how to get  number when click the any cube 
pls help
Title: Re: Material name?
Post by: Lane on December 03, 2013, 07:36:45 AM
After you use Mouse Pick and store the game object, use the Get Material action to get the material on that object.
Title: Re: Material name?
Post by: cursed1 on December 03, 2013, 08:20:27 AM
ok i use  get material but variable is material
i need  convert material to int  :D
because random number on random cube
i want
result = clicked cube texture number + clicked cube texture number
 
how to make it
sorry my english
thanks for help
Title: Re: Material name?
Post by: Lane on December 03, 2013, 08:40:58 AM
Hmm... Maybe someone else knows how but as far as I know you can't do that - at least not that way.

Perhaps you could store the materials as variables before you use them in the random set, name the variable the number you want and then getting the material would return their name as the numerical position.
Title: Re: Material name?
Post by: jeanfabre on December 04, 2013, 05:11:16 AM
Hi,

 use a hahstable or an arraylist to maintain a list of your materials, then you can reference a particular material by its index in the the list or by its key ( string)

Use ArrayMaker for this.

https://hutonggames.fogbugz.com/default.asp?W715

bye,

 Jean
Title: Re: Material name?
Post by: cursed1 on December 05, 2013, 03:29:06 PM
thank you