iShellz Posted February 13, 2014 Share Posted February 13, 2014 I was wondering how to use the "for each" function to move all the items in a group. looking for the equivalent of this C# snip it. foreach (cat i in cats){ i.x += 10;} Link to comment Share on other sites More sharing options...
joseym Posted February 21, 2014 Share Posted February 21, 2014 A group contains an array of children, so you can look thru as such:group.children.forEach(function(child, index){ child.body.velocity.x = ##;}); Link to comment Share on other sites More sharing options...
Recommended Posts