playMaker

Author Topic: [SOLVED]Compare Material not working?  (Read 1794 times)

Alatriste

  • Full Member
  • ***
  • Posts: 195
[SOLVED]Compare Material not working?
« on: October 21, 2015, 03:39:24 PM »
Hi all, I have a weird case here. I'm checking an array and comparing the materials of two game objects. However, when they are both the same one, the equal event is not sent. I'm wondering if it is because one of them is labeled as instance (although I'm not really sure why). Any ideas?  Thanks!
« Last Edit: October 28, 2015, 06:18:27 PM by Alatriste »

Alatriste

  • Full Member
  • ***
  • Posts: 195
Re: Compare Material not working?
« Reply #1 on: October 28, 2015, 06:17:39 PM »
I'm going to reply myself just in case is useful for somebody in the future. After some investigations, I found out that is not a good idea to compare materials between different objects, as the ID of the material might be different that the name you see in the debug mode.

So basically I had to take another approach and get the name of the gameObjects instead and storage them in string variables. That way I could confirm that both strings were the same, therefore, I managed to make work my script.


taterbug3000

  • Playmaker Newbie
  • *
  • Posts: 3
Re: [SOLVED]Compare Material not working?
« Reply #2 on: June 30, 2017, 11:38:11 AM »
This WAS useful to someone in the future!  ME!  Thank you!