playMaker

Author Topic: [SOLVED] Null Reference Exception with GoToStateByName  (Read 989 times)

hockeygoalie78

  • Playmaker Newbie
  • *
  • Posts: 8
[SOLVED] Null Reference Exception with GoToStateByName
« on: January 21, 2020, 10:07:11 AM »
I have been attempting to get my FSM to go to a particular state given the name of it in string format. I'm using the GoToStateByName action (which I have downloaded separately and added into my project), but I am unable to get it to work properly. I have the correct name stored in a variable, but when I use the action it gives me a null reference exception on the Fsm sourceFsm on line 85. Does anyone know what might be causing that?

For reference, I found the GoToStateByName action here:
https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/5d388f4bfbec8144aaa5272759f3cc7c76af90d5/Assets/PlayMaker%20Custom%20Actions/StateMachine/GoToStateByName.cs
« Last Edit: January 21, 2020, 02:20:34 PM by hockeygoalie78 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Null Reference Exception with GoToStateByName
« Reply #1 on: January 21, 2020, 12:04:12 PM »
Hi.
You might have an outdated version of the action, it is best to use the Ecosystem to download custom actions

for the name, also make sure there is no space at the end or beginning.

hockeygoalie78

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Null Reference Exception with GoToStateByName
« Reply #2 on: January 21, 2020, 02:19:55 PM »
Getting it from the Ecosystem rather than the Git repository worked, thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] Null Reference Exception with GoToStateByName
« Reply #3 on: March 03, 2020, 02:06:35 AM »
Hi,

 yes, Unity 3 is very very old indeed :)

Bye,

 Jean