Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nickfourtimes on March 12, 2019, 03:38:53 PM

Title: GetProperty can't get MonoBehaviour property from component
Post by: nickfourtimes on March 12, 2019, 03:38:53 PM
Heya, I have a UI component that links to the UI components around it:

Code: [Select]
using UnityEngine;

public class MyComp : MonoBehaviour {
    public MyComp up;
    public MyComp down;
    public MyComp left;
    public MyComp right;
}

In my FSM, I have an Object variable set to MyComp type. What I want to do is use GetProperty to get, say, the "up" MyComp.

However, when I use the GetProperty action, the Property drop-down doesn't show up, down, left, or right as accessible variables. Am I making wrong assumptions about the GetProperty action, or is something not set up correctly?
Title: Re: GetProperty can't get MonoBehaviour property from component
Post by: djaydino on March 13, 2019, 02:47:31 AM
Hi.
the Get Property does not know what variable type MyComp is.

You can convert to a standard variable inside the script (string, int, float, etc)

or you can make a custom action to get the variables.

Here is a link to the PlayMaker Api : https://hutonggames.fogbugz.com/default.asp?W127
Title: Re: GetProperty can't get MonoBehaviour property from component
Post by: Alex Chouls on March 13, 2019, 07:51:24 AM
We should support your example use case... let me double-check and hopefully get it into the next update.