Hi, I know this must seem very basic but how do I declare variables that are NOT exposed in the editor and how do I communicate with them from other scripts. I thought
Entity A
var myTest=42;//declared in root of script
Entity B
this.otherEntity=this.app.root.findByName(“Entity A”);
console.log(this.otherEntity.myTest);
You’re running into issues of scope here. Since you are declaring that variable globally, you would just use myTest as it will be the same across all scripts and entities loaded in the browser. If you wanted to be specific to each entity, you would want to declare it within the scope of the script instance. The way you would access it would be like so: