Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Joakim on June 02, 2018, 08:19:35 AM

Title: Can I compare properties of slotted game objects and scriptable objects?
Post by: Joakim on June 02, 2018, 08:19:35 AM
Hi, in playmaker, is there an action or event which can compare values of properties of classes which are attached to a game object, compare those with another objects properties.

Concerete example would be, on my scene I have a "Building" game object with Building.cs monoBehavuor attached to it, this .cs has int Tier property. Now on enabling my UnitBuild Canvas I want to turn on Tier 2 panel object if Tier of my building is greater than 1.

So I'd like to create a comparison action which is triggered on my canvas BecameVisible, then slot my building object into my action, select Tier property, select comparison operator ">" and enter number 1 in another field, and if true then trigger unity event which activates my panel canvas.

Another use case would be using scriptable objects, comparing if health property of scriptable object "PlayerSO" is less than damage property of "EnemySO".

See attached picture "Example.jpg".
Something like that, but also with an option to manualy enter value instead of slotting object2.