playMaker

Author Topic: Get FSM Int not working correctly  (Read 784 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Get FSM Int not working correctly
« on: August 25, 2023, 08:44:07 AM »
It seems to me that this action is not working.
I wasted on it half day, to no avail.

Initially I thought that it couldn't find the GameObject, because it's nested and not on the root.
So I changed, got the Parent and then the Child.
Still nothing.

It looks like the action is stuck in getting the variables from OWNER, which is something I don't need. I need to get the variable from another object.
But despite the other object being found, stored and selected, it looks like the action still pulls the data from the Owner.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Get FSM Int not working correctly
« Reply #1 on: August 25, 2023, 08:46:17 AM »
You can see in images 5 that the menu of the action shows variables from Owner.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Get FSM Int not working correctly
« Reply #2 on: August 25, 2023, 10:26:55 AM »
Hi,
I think your misunderstanding how this works :)

On variable name you connected a 'int Variable' (V_ENERGY_Int) and converting it to a string.
Which will convert to the int value in it and use that to find the variable name on the ENERGY_2 fsm.

On variable name press on the = , then set the Name of the variable (the int variable name on the ENERGY_2 that you want to get)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Get FSM Int not working correctly
« Reply #3 on: August 25, 2023, 03:35:36 PM »
So you mean that the first 2 fields refer to the other FSM, and must be set manually, if I understand correctly?

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Get FSM Int not working correctly
« Reply #4 on: August 25, 2023, 03:37:13 PM »
Well it worked, thank you.

But I really think this should be explained a bit... I'm not exactly a stupid guy and usually I have no problem in understanding how stuff works, but I really did expect to get the variable list on the menu, after specifying the FSM name...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Get FSM Int not working correctly
« Reply #5 on: August 25, 2023, 05:58:17 PM »
Hi.
'Variable Name' should be sufficient, but anybody can make mistakes :)

Variable Name is the name of the variable that you want the get the value from.
I don't see how you can name it better than 'Variable Name'

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Get FSM Int not working correctly
« Reply #6 on: August 25, 2023, 09:25:31 PM »
Sometimes things get comples, and having the menu with the variables list would help  ;D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Get FSM Int not working correctly
« Reply #7 on: August 29, 2023, 10:10:54 AM »
Hi.
Yea, but for this action its not really possible as it can be from an object from a different scene (which you would want to access at runtime) , a prefab loaded in the scene during runtime, a prefab loaded with resources load.

But if you drag/drop for example a prefab in the specified gamebject directly, then use the ... on fsm name you get drop down with the fsms on that object.
same for the variable name.

so what i do to be sure to have the correct name, 1st drag the prefab/gameobject in.
then after setting it, remove the prefab/gameojbect and set the variable on the Specify Game Object.


PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Get FSM Int not working correctly
« Reply #8 on: August 29, 2023, 10:19:04 AM »
Hi.
Yea, but for this action its not really possible as it can be from an object from a different scene (which you would want to access at runtime) , a prefab loaded in the scene during runtime, a prefab loaded with resources load

Good reasons!
Thank you for all!