Are you refering to the variable binding done within the blackboard, or the legacy component usage “Blackboard Property Binder”.
If you are using the “Blackboard Property Binder”, please consider using the new way of binding variable to a property which is done by the small button on the far right of each variable in the blackboard GUI.
The new way, doesn’t really use reflection other than creating a delegate and is far more efficient.
If you are refering to the new binding way, can you please provide what the error showing is if any?
Sorry for the late response, even using the new binding variables doesn’t work on iOS. I believe this is due to AOT compliation rendering any use of Reflection in the actions as redundant, which ultimately means that this action can’t be run on iOS based devices.
It would be cool if NodeCanvas could mark up what actions are not supported depending on the target platform that is selected or similar.
Hello,
That is very weird, iOS supports reflections and delegates, though it doesnt runtime compiled code, but a delegate is not that.
Actualy the whole code for the new way of binding variables is summed up to this:
Sorry ignore previous message, not sure how to delete it.
Ok so the test case is super simple, empty scene, one game object, behaviour tree graph with a vector bound to the transform position, as in the attachment.
In the editor this runs perfectly fine, the object floats up as expected,
On an iOS build, the behaviour tree errors with:
ExecutionEngineException: Attempting to JIT compile method ‘(wrapper delegate-invoke) System.Func1<UnityEngine.Vector3>:invoke_Vector3__this__ ()’ while running with –aot-only.
at NodeCanvas.Variables.VariableData1[UnityEngine.Vector3].GetValue () [0x0000b] in /Users/matthew.newcombe/work/frodo/Client/Assets/Plugins/NodeCanvas/Core/Blackboard/VariableData.cs:83
…
Thanks for the provided detailed information.
One possible solution would be to set the API Compatibility level to ‘.NET 2.0 Subset’
(Edit/Project Settings/Player)
I will also include some platform checks for binded variables so that it works in iOS in any case, but through Invoke reflection call.