Terrain fails to return entities with no region_collision_shape component

I’m not sure if this is a bug, but it’s weird behavior. If your entity doesn’t have a region_collision_shape component, radiant.terrain.get_entities_X won’t return it.

A simple example of this can be demonstrated by placing a stonehearth:terrain:tall_grass entity (default but unused asset) in the world, selecting it, and then doing the following command in the Lua console:

radiant.terrain.get_entities_at_point(radiant.entities.get_world_grid_location(e))

The result, rather surprisingly, is { }. Despite the fact that the entity has a location, it is unfindable.

Is this intentional? Is there another more universal way to find entities than the radiant.terrain functions?

This is deliberate. Only entities with a region_collision_shape or a mob_collision_type ~= “none” will be discoverable.

If you want the item to be discoverable, the typical method would be to give it a mob_collision_type of “tiny”.

Other than searching or tracking all entities that are children of the root entity, I can’t think of any other methods to find these “non-interactive” entities.

Hope this helps!

2 Likes