get_instance_player_id

Returns the ID of the player associated with the object. Used for referencing objects that you normally don’t have access to.

ArgumentTypeDescription
instance_id:realThe ID of the instance to get the player ID of

Example, called from hit_player.gml:

// plays a concerned sound whenever you hit Maypul while she has Lily out:
with (asset_get( "plant_obj" )) {
if (get_instance_player_id( self ) == other.hit_player_obj) {
sound_play( "plant_concerned_sound" );
}
}