Tilemap Convert World Rect To Bounds
Convert a world-space Rect into tilemap cell BoundsInt coordinates.
Use this to turn gameplay/world regions into reusable tile cell regions for other tilemap actions.
Parameters
| Parameter | Description |
|---|---|
| Tilemap | Tilemap whose Grid/layout is used for conversion. |
| World Rect | World-space rect to convert. |
| Clamp To Tilemap Bounds | If true, clamps output bounds to tilemap cellBounds. |
| Bounds | Output BoundsInt in tilemap cell coordinates. |
| Cell Min | Optional output minimum cell (inclusive). |
| Cell Max Inclusive | Optional output maximum cell (inclusive). |
Notes
- Right/top world edges are treated as exclusive to avoid off-by-one overlap.
- If Tilemap is missing or rect is invalid, output bounds are empty.