# CreateWeldJoint

## Description

Creates a weld joint between two sprites. The weld joint attempts to limit all relative movement and rotation between the two sprites. Specify a single anchor point in world coordinates with the sprites already in the desired positions. The joint is not a perfect fixture and given a large enough force the sprites may shift out of position.
The anchor point can be offset from the sprite center positions.
A joint ID will be returned to reference this joint later, a joint may be deleted by the system if any of the sprites it connects are deleted.

## Definition

integer CreateWeldJoint( iSpriteIndex1, iSpriteIndex2, x, y, colConnected )

UINT agk::CreateWeldJoint( UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, int colConnected )

CreateWeldJoint( iJointIndex, iSpriteIndex1, iSpriteIndex2, x, y, colConnected )

void agk::CreateWeldJoint( UINT iJointIndex, UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, int colConnected )

## Parameters

- iSpriteIndex1 - The ID of the first sprite to join.
- iSpriteIndex2 - The ID of the second sprite to join.
- x - The x coordinate of the anchor point.
- y - The y coordinate of the anchor point.
- colConnected - Set whether the two sprites connected by the joint can collide with one another, 0=no, 1=yes.
- iJointIndex - The ID to use for this joint.