Regarding the BBParameters resulting to NONE, most probably the reason is that the graph in which your custom SubFSM action is in, is a prefab or an asset reference, but you are referencing an FSMOwner from the scene, in which case and by Unity standards, Asset (in the project) can’t have scene object references. Can you confirm that this is indeed the case?
Regarding your 2nd question, a normal GameObject variable can be assigned to any BBParameter<T> where T is a component type (like FSMOwner is). This is done for convenience and in runtime, the actual component is fetched from the assigned gameobject automatically, just like you’ve correctly guessed. 🙂
Your way of utilizing SubFSMs via FSMOwners, can become dirty down the road of the project and result in unintended behavior, because an FSMOwner component is very different than just an FSM asset. An FSMOwner is only meant to be a component which has an FSM assigned and behave by that FSM. It should really not be used as a way of utilizing SubFSMs of the same root “owner” since by definition it is treated as a different owner 🙂
I would strongly recommend using the “official” way of using SubFSMs or SubTrees. 🙂 If the sole reason of looking at an alternative is so that each SubFSM has it’s own blackboard variables, then I would suggest to please be a little patient until the next version, where SubFSMs and SubTrees will be able to use their own local variables and able to map those variables from the root graph variables.
Is this indeed the reason?
Let me know.
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.