I am trying to use scripting to create an object.
runOnStartup( async runtime => { runtime.addEventListener('afterprojectstart', () => afterProjectStart(runtime)) }); function afterProjectStart(runtime) { const enemy1 = runtime.objects.Enemy1.getFirstInstance(); runtime.createInstance(enemy1, 2, 100, 100) }
I get runtime.createInstance is not a function
runtime.createInstance is not a function
Any ideas?
Develop games in your browser. Powerful, performant & highly capable.
Found the solution
runtime.objects.Enemy1.createInstance(layer, x, y)