Looping through a list of paths

Hi all : So I have this cospace where I have 3 animals and 3 dedicated paths. Animals have their own list. Paths have their own. How do I loop through the animal list whilst also ensuring each animal object is walking on a corresponding path object too? I tried making a nested loop but it does not seem to be working. Some help appreciated.

Hello @Shashi_Krishna, thank you, nice challenge :wink:.
I thought to this solution: set the number of items (animals and paths) starting by 0 because list index start by 0 so you can recall the correct item in the function for each element of list getting the right path for each animal.

Hope this helps,
Giuseppe

2 Likes

Hi @Shashi_Krishna first question is: do you have a CoSpaces Pro account? If not it will not be possibile to do this. You don’t have enough blocks.
If you have did you enabled all the blocks? Just click where you see written (in italian in my case: AGGIORNA) UPDATE

.
*For others who have a similar problem the first question is: what kind of account do you have?

Hi there @astrid_hulsebosch. I do have a pro account. And yes : I know we can move each animal forward but I want them to follow a specific path and not just move forward for X meters. Thank you!

This looks promising. Thank you @Giuseppe_Schiuma. Shall give it a shot.

So @Giuseppe_Schiuma I added a run separately block as an addition. It works! I now know why you named the paths 0, 1 and 2 so that the index value can be matched up.

Thanks again!

2 Likes