yigitakkok Posted February 4, 2016 Posted February 4, 2016 Hi, I have a variable a = 0. It is changed to 5 in a callback function. But onUpdate function I get 0 not 5. How can I access new value? int a = 0 Body right_holder_body; right_holder_body.setContactCallback(functionid(onColl)); void onColl() { a = 5; log.message("%d",a); // Output: 5 } void onUpdate() { log.message("%d",a); // Output: 0 } Thanks.
maxi Posted February 5, 2016 Posted February 5, 2016 Hi Yiğit, could you please clarify the scopes of your code? It doesn't clear, what namespaces or classes variable and body declaration belongs to, and from what place onUpdate method get called. It will be better, if you provide full minimum working sample code.
Recommended Posts