playMaker

Author Topic: SetFsmVariable sometimes setting wrong values  (Read 98 times)

PollitronicDev

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
SetFsmVariable sometimes setting wrong values
« on: September 19, 2018, 03:05:13 AM »
Hello there!

This is my setup:

- I have a prefab with 2 FSMs: FSMa and FSMb.
- Each of these FSMs has a (float) variable: VarA and VarB.

Now I need to set VarB (in FSMB) to the value of VarA (in FSMA), so from FSMA I use a SetFsmVariable action as shown in the image.

The problem is that, when running an instance of the prefab and executing the action, the value passed to VarB is always the value VarA had originally (the one set in the Variables tab). In other words, the action ignores any changes done at runtime to VarA, it always sends the original value. I suspect it might be sending the value in the prefab instead of the one in the instance.

Strangely, there was one execution in which the values passed were correct. However, the next time I executed the game (I changed nothing) it went back to the wrong behaviour, and kept like this.

Any idea of what can be causing this (bug?), or if I'm doing something wrong?

Thanks in advance!

miguelfanclub

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: SetFsmVariable sometimes setting wrong values
« Reply #1 on: October 09, 2018, 03:33:37 AM »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13395
  • Official Playmaker Support
    • View Profile
Re: SetFsmVariable sometimes setting wrong values
« Reply #2 on: October 10, 2018, 03:56:56 AM »
Hi,

On what version of Unity are you working?
 
Bye,

 Jean