Hello,
I am building some custom actions to interface with a third party asset that I am using on my project. I need to be able to get/set variables on a script. I have successfully managed to nail down the get action. I accomplished this by using a line like this:
tempFloat = root.moduleParameters.GetFloat(strings[i].Value);
PlayMakerUtils.ApplyValueToFsmVar(Fsm, variables[i], tempFloat);
The first line gets the third party float and stores it in a tempFloat, the second line copies that value to the FsmVar to be useable in PM. So far so good.
My problem comes when I try to do the opposite, and convert my FsmVar to a local variable like tempFloat. I have scoured the API for custom actions and I can't find a single method that doesn't end in something like this:
"Cannot convert type hutonggames.playmaker.FsmVar to type float."
Is there a reliable way to convert from FsmVars to local variables like ints, floats, strings, bools etc? I know the FsmVar knows what type it is, because I have successfully used this in my get function to filter them:
if (variables[i].Type == VariableType.Float)
Thank you for any help!
Edit: also to clarify, I am using FsmVars rather than specific types like FsmFloats because I want to have a dropdown where I choose to get/set any number of variables that aren't necessarily the same type.