Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: logiquefloue on October 17, 2013, 04:33:27 AM

Title: mouse pick: get material texture.
Post by: logiquefloue on October 17, 2013, 04:33:27 AM
Hello,

1 / I want to Get the texture or material of the object hit by mouse. I tried to use "Get Material" but that function first frame. Someone an idea?

2 / I have a game object with two materials, how to return the second material with "Get material"?

3 / In PlayMaker, can we compare two textures?

Thank you for your help  :)
Title: Re: mouse pick: get material texture.
Post by: Lane on October 17, 2013, 07:20:47 AM
You can use Mouse Pick or something to grab the GameObject and store it in a variable, then use Get Material to grab and store the Material of that GameObject in a variable. It will take more than one state to do this.

There is no Material Compare action that I know of, so I made one for you.

http://hutonggames.com/playmakerforum/index.php?topic=5207.0
Title: Re: mouse pick: get material texture.
Post by: logiquefloue on October 17, 2013, 07:46:02 AM
Lane thank you very much :D I'll try it all
Title: Re: mouse pick: get material texture.
Post by: taterbug3000 on June 28, 2017, 10:00:22 AM
I'm using Material Compare action and when I toggle breakpoint, I can see that it is grabbing the two materials.  However, when equals, I have it go to true event to a new state to add 1 to an int variable but it doesn't work.  I have false going back to top of a loop or to just a final state for now.  If I make true and false both go to my add 1 to int state, then it works and adds 1 to the int variable.  Why isn't the equals event sending properly?  Any ideas?  Is it just my logic?
Title: Re: mouse pick: get material texture.
Post by: djaydino on June 28, 2017, 12:40:52 PM
Hi,
I just tested this by placing a material into a variable and on 'Compare To' i placed the same material.
That seems to work.

How are you getting the materials?