#include <include/flecs.h> FLECS_API ecs_entity_t ecs_get_target_for_id(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, ecs_id_t id)
Get the target of a relationship for a given id. This operation returns the first entity that has the provided id by following the specified relationship. If the entity itself has the id then entity will be returned. If the id cannot be found on the entity or by following the relationship, the operation will return 0.
world- The world.
entity- The entity.
rel- The relationship to follow.
id- The id to lookup.
- The entity for which the target has been found.