I want to have the people in my scene perform random animations - can I do this with a list? I have a list of people and made a function called “randomMovement” with a screen item parameter “target” - I can use the Move block to move “target”, but I would like it to perform a random animation instead of moving, but I can’t figure out a way.
The play animation CoBlock doesn’t take variables. So if you want to play random animations from the list, you can use TypeScript:
let objects = [“Casual girl”, “Casual boy”];
let animation = [“Run”, “Skip”];
let objName = objects[Math.floor(Math.random()*objects.length)];
let animationName = animation[Math.floor(Math.random()*animation.length )];
(Scene.getItem(objName) as AnimatedItem).animation.play(animationName)
Feel free to remix this example and explore the code: