playMaker

Author Topic: GetProperty can't get MonoBehaviour property from component  (Read 1107 times)

nickfourtimes

  • Playmaker Newbie
  • *
  • Posts: 27
GetProperty can't get MonoBehaviour property from component
« 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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: GetProperty can't get MonoBehaviour property from component
« Reply #1 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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: GetProperty can't get MonoBehaviour property from component
« Reply #2 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.