# SetSpritePhysicsCOM

## Description

Sets the center of mass (COM) relative to the sprite's offset. By default the AGK calculates the best location for the COM based on the size and location of all shapes attached to the sprite. Setting it to 0,0 will put the COM on the sprite's offset point (and center of rotation). If the COM is very different from the offset point the sprite may seem unstable as it will behave like an unbalanced spinning top.

## Definition

SetSpritePhysicsCOM( iSpriteIndex, x, y )

void agk::SetSpritePhysicsCOM( UINT iSpriteIndex, float x, float y )

## Parameters

- iSpriteIndex - The ID of the sprite to modify.
- x - The x coordinate of the center of mass.
- y - The y coordinate of the center of mass.