Need some help with object picking

Would like a bit of help here. I’m basically just trying to get it so that after the timers on the “M” objects hit 5 seconds they pick a random “draggableobjects” and move towards their position while their animation is set to “newsprite”. However, all of the “M” objects end up creating a line between draggableobjects and not going to the draggableobject’s location.


I am not sure if that is the case
BUT
I think you should not use action to pick random object but CONDITION and it should be in parent event wand what you have that repeat for each object should be sub event

So event like CONDITION pick random draggable

Now sub event and here you just put your repeat for each object

It’s more efficient to do conditions before the for each object. That way it only loops through the picked objects instead of every object. You need to unlink the objects before you create a new link.

Here’s how I would do it. You would need to add your animation condition before the 2nd for each object. Again, it’s better to do the condition before the loop except for things like the link condition that needs to be done one object at a time so you get the matching pairs.

thanks for the advice! I forgot that “pick a random object” could be used as a condition

1 Like

Welcome. Yeah, there are a few methods (for lack of a better word) that can be used as conditions or actions. It’s a bit weird. I prefer to use them as conditions. It doesn’t really affect the functionality but I like how it splits the process into smaller chunks instead of a long list of actions.