Is there a way to call functions by string WITHOUT mapping? I'd need to map 100+ things otherwise.
You can do it with a bit of scripting:
runtime.callFunction("FunctionName")
or
runtime.callFunction("FunctionName", param1, param2, ...)
Thanks! I tried doing this but it didn't seem to work, the function is in the audio event sheet, whereas this is in the menu event sheet.
Is this a problem with the scripting or something else?
Develop games in your browser. Powerful, performant & highly capable.
That's not how you access instance variables from the script. You need something like this:
var t = runtime.objects.Trigger.getFirstInstance(); runtime.callFunction(t.AudioTrigger)
And if there are multiple Trigger instances, you'll have to pick the correct one..
It may be much easier to use a local variable - copy function name from the TriggerTrigger.AudioTrigger into the local variable and then do this:
runtime.callFunction(localVars.functionName)
Alright thanks! Will try it now.
Hey man it worked great! Thanks!