# Controlling Sprites in a Group

**URL:** <https://forum.code.org/t/controlling-sprites-in-a-group/23338>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-22\
**Created:** [December 10, 2018, 6:09pm UTC](https://forum.code.org/t/controlling-sprites-in-a-group/23338 "2018-12-10T18:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjdeister](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mjdeister/32/348_2.png) [@mjdeister](https://forum.code.org/u/mjdeister)\
**Post date:** [December 10, 2018, 6:09pm UTC](https://forum.code.org/t/controlling-sprites-in-a-group/23338/1 "2018-12-10T18:09:41Z")

</div>

Today one of my students but a few sprites in a group. I thought we could iterate through the group with a for loop and get each sprite to check their x position. That seems to cause a syntax error. Any suggestions about how the x position of each sprite could be checked? Do I need to create a temporary sprite variable to hold each element in the group to check it?

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [December 10, 2018, 6:50pm UTC](https://forum.code.org/t/controlling-sprites-in-a-group/23338/2 "2018-12-10T18:50:25Z")

</div>

Hi Myra,

Can you paste in the share link so we can look at the code?

Thanks,  
Elizabeth
