playMaker

Author Topic: mouse pick: get material texture.  (Read 3300 times)

logiquefloue

  • Playmaker Newbie
  • *
  • Posts: 35
mouse pick: get material texture.
« 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  :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: mouse pick: get material texture.
« Reply #1 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
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

logiquefloue

  • Playmaker Newbie
  • *
  • Posts: 35
Re: mouse pick: get material texture.
« Reply #2 on: October 17, 2013, 07:46:02 AM »
Lane thank you very much :D I'll try it all

taterbug3000

  • Playmaker Newbie
  • *
  • Posts: 3
Re: mouse pick: get material texture.
« Reply #3 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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: mouse pick: get material texture.
« Reply #4 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?