so I'm literally crying right now as the function I created is not working saying that it is not defined I thought that it is because the scope of the function can't reach the scriptsInEvents.js so I use import following this construct.net/en/tutorials/upgrading-projects-classic-2652
and it's still now working idk what to do T_T
the code in event sheet is like this
var AllEnemies = runtime.objects.EnemyDetector.getAllInstances();
var EnemyUID = [];
addEnemyUID(AllEnemies, EnemyUID);
console.log(EnemyUID);
var temp = AllEnemies[AllEnemies.length-1];
console.log(temp.uid);
and the function on the utilities.js which is addEnemyUID()
export function addEnemyUID(AllEnemies, EnemyUID){
var instance = AllEnemies[AllEnemies.length-1];
EnemyUID.push({id: instance.uid});
}
importsForEvents.js
import * as Utils from "./utilities.js";
I'm new to construct and javascript so I might have some error in the way I code or iDK please educate me T_T