In
https://github.com/armory3d/armory/blob/master/Sources/armory/logicnode/CallFunctionNode.hx
the line
var object: Object = inputs[1].get();
seems to be wrong.
The input 1 is Trait and as we can see in
https://github.com/armory3d/iron/blob/master/Sources/iron/Trait.hx
its not extended from Object or anything. I have no idea why it works in Krom, but when running for example a Windows build it always gives runtime cast exception and crashes the app.
Solution:
var object: iron.Trait = inputs[1].get();
Works in Krom, Windows and Android builds.
_Sorry I wont do a PR :P, short on time._
Thanks for the report. I think we shouldn't cast the incoming value at all and just set it to Dynamic. This way this node can call arbitrary functions from all kinds of objects (the socket says Trait/Any, maybe we find a better name for that). I won't open a PR right now because I currently can't test the HL/C target because of https://github.com/armory3d/armory/issues/1899#issuecomment-700663548.
Most helpful comment
Thanks for the report. I think we shouldn't cast the incoming value at all and just set it to
Dynamic. This way this node can call arbitrary functions from all kinds of objects (the socket saysTrait/Any, maybe we find a better name for that). I won't open a PR right now because I currently can't test the HL/C target because of https://github.com/armory3d/armory/issues/1899#issuecomment-700663548.