playMaker

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

nickfourtimes

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
GetProperty can't get MonoBehaviour property from component
« on: March 12, 2019, 12: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: 4022
    • View Profile
    • jinxtergames
Re: GetProperty can't get MonoBehaviour property from component
« Reply #1 on: March 12, 2019, 11:47:31 PM »
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: 3527
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: GetProperty can't get MonoBehaviour property from component
« Reply #2 on: March 13, 2019, 04:51:24 AM »
We should support your example use case... let me double-check and hopefully get it into the next update.