# PhysicsRayCastGroup

## Description

Casts a ray through all physics objects including sprites that have physics turned on and stores the closest item hit. Results of a ray cast can be retrieved using the other ray cast functions such as GetRayCastNormalX.
If the ray starts inside a shape that shape will not be counted in the results.
This function filters the sprites that are checked so only sprites of a certain group are checked, a group value of 0 means all groups will be checked.
Returns 1 if there was a collision, 0 if not.

## Definition

integer PhysicsRayCastGroup( group, x, y, x2, y2 )

int agk::PhysicsRayCastGroup( int group, float x, float y, float x2, float y2 )

## Parameters

- group - The group ID to check for intersection with the ray, can be negative.
- x - The X coordinate of the start point in world coordinates.
- y - The Y coordinate of the start point in world coordinates.
- x2 - The X coordinate of the end point in world coordinates.
- y2 - The Y coordinate of the end point in world coordinates.