Author Topic: Help! FsmObject's Value is always Null.  (Read 361 times)


  • Junior Playmaker
  • **
  • Posts: 62
    • View Profile
Help! FsmObject's Value is always Null.
« on: August 29, 2017, 09:03:14 PM »
I'm using a FsmObject variable. Its value always return null! Help! I'm not a programmer, hope someone good at it could help me out!

In my action script, before doing the real thing I wrote this to initialize the FsmObject.
if (ABC.value == null)
    Debug.log("ABC.value is null!")
    ABC.value = new MyObject();

MyObject is a simple class:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
   public class MyObject: Object {
      public bool b;
      public MyObject()
         this.b = true;

Every time my Action is entered or using everyFrame. I got this "ABC.value is null!" log and the ABC.value are reset. I can't store the result into the ABC FsmObject variable. :(


  • Administrator
  • Hero Member
  • *****
  • Posts: 12740
  • Official Playmaker Support
    • View Profile
Re: Help! FsmObject's Value is always Null.
« Reply #1 on: September 01, 2017, 04:17:50 AM »

it could be that you need to add an attribute for it to be serializable.

or Unity objects are special ( buggy in their implementation...) and == null doesn't work in some cases.

can you try this:

 aObj == null || aObj.Equals(null);

it could be also that initializing the object like that doesn't work. can you do that on Reset() instead?