here is my dilemma: i have a stage where thousands of tiny balls are falling onto. if i wanted to set it to apply force to all of them when i touch a position, to go away from the position, how would i do it? i already tried making it just apply the force, but it only applied it to the last ball that was spawned. how would i get it to do it to all of them? [import]uid: 147322 topic_id: 26683 reply_id: 326683[/import]
Have the balls in a table and iterate through it to apply force to all of them one by one based on their location compared to the touch location. [import]uid: 52491 topic_id: 26683 reply_id: 108294[/import]
how would i make it iterate through them? [import]uid: 147322 topic_id: 26683 reply_id: 108310[/import]
With a for loop. Eg;
[lua]for i = 1, #myTable do
–do something
end[/lua] [import]uid: 52491 topic_id: 26683 reply_id: 108446[/import]
thank you! [import]uid: 147322 topic_id: 26683 reply_id: 108690[/import]