Accessing the variable in created event script
How do I access the varialbe of an script that I created through a script? Is it possible? Here is my Code
// -----JS CODE-----
// @input SceneObject objNull
function onStart(){
applyCode(script.objNull)
}
function applyCode(obj){
var updateEvent = obj.createComponent("Component.ScriptComponent").createEvent("UpdateEvent")
updateEvent.bind(function(){
print("updating")
})
}
var tapEvent = script.createEvent("TapEvent")
tapEvent.bind(function(){
stopCode(script.objNull)
})
function stopCode(obj){
obj.getComponent("Component.ScriptComponent").updateEvent.enabled = false
}
onStart()
Please help, thank you