# SetSpriteGroup

## Description

Assigns this sprite to a group for filtering collisions (physics or non physics). In physics, sprites of the same positive group ID will always collide, whilst those that share the same negative group ID will never collide. Those with a group ID of zero (default), or differing group IDs move on to the category filter check.
When the sprite is not setup for physics this test will only apply to the base shape at shapeID 1.
By default this sets all shapes to the same value, you can set this value on a per shape basis by specifying a shapeID value greater than 0. Shape IDs start at 1 for the first shape, with shapeID 0 meaning apply it to all shapes.

## Definition

SetSpriteGroup( iSpriteIndex, group, shapeID )

void agk::SetSpriteGroup( UINT iSpriteIndex, int group, int shapeID )

SetSpriteGroup( iSpriteIndex, group )

void agk::SetSpriteGroup( UINT iSpriteIndex, int group )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- group - The group ID to assign to this sprite.
- shapeID - the ID of the shape to change, 0 to set all the sprite's shapes to this value