Hello (excuse my english), <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed">
How do I jump enemy every radom second with "for each instance" function.
I tried that but it is jumping all at once or just one jump.
http://joueralamaitresse.com/test/enemy_jump_random.capx
Help me please. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">
If I understood you correctly:
Use timer behaviour (add it for the enemy object), set timer to random duration for each enemy. On timer expiration do jump and then set new timer with new random duration.
I personally avoid putting every X seconds inside a for each object loop, because loops need to finish their actions within one tick/frame. Timer behaviour was made for such things (that need to be executed across multiple frames/ticks) and it works great.
Please see attached capx (I decided to go with 1-3 seconds between jumps, also disabled your events for jumping):
https://www.dropbox.com/s/e5igcja8182g9 ... .capx?dl=1
Note: this will only work if no new enemies are created after layout start. If new enemies are created while it is running, you would also need to add an "on enemy create" event to set the timer for that new enemy.