Randomize Presets
-
Hello, I tried this code to Random choose my Presets.
const var Random = Content.getComponent("Random"); inline function onRandomControl(component, value) { if(value) { local myRandName = myPresetList[Math.randInt(0,myPresetList.length)]; Engine.loadUserPreset(myRandName); } }; Content.getComponent("Random").setControlCallback(onRandomControl);
I can compile it but when I click the button it says
User preset /Users/usr/Downloads/project/UserPresets/preset - 1 doesn't exist
But all of these presets exist.
-
@meto396 Try adding
+ ".preset"
to the end ofmyRandName
-
@meto396 yes this worked thank you