im very new to programming, im trying to use script to patch bridging technique. i have no idea why this doesn't work, here's my code:
const Scene = require('Scene');
const Patches = require('Patches');
export const Diagnostics = require('Diagnostics');
const patchValue = Patches.getScalarValue('GameScore');
Promise.all([
Scene.root.findFirst("sampletxt"),
]).then(function(results){
var ScoreText = results[0];
ScoreText.text = patchValue.toString();
});
Diagnostics.watch('runtime -', patchValue); // im using this line to see if the script reads the value from patch.
here is the error from the console log:
Use PatchesModule.outputs.getScalar
instead!
@
HermesRuntime
This API is deprecated, please upgrade to the newest SDK version. Message:
@
HermesRuntime
Possible Unhandled Promise Rejection: Unexpeted SceneObject reference: {"identifier":"2_d_text_model:7030-1be1a0e4-3bb6-4a3b-bc9c-e17b7b57aa6c","name":"sampletxt","materialIdentifier":"","className":"planarText","modelId":505}
Please help me, thank you
Patches Layout