Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
GridMap¶
Inherits: Node3D < Node < Object
Node for 3D tile-based maps.
Description¶
GridMap lets you place meshes on a grid interactively. It works both from the editor and from scripts, which can help you create in-game level editors.
GridMaps use a MeshLibrary which contains a list of tiles. Each tile is a mesh with materials plus optional collision and navigation shapes.
A GridMap contains a collection of cells. Each grid cell refers to a tile in the MeshLibrary. All cells in the map have the same dimensions.
Internally, a GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells.
Note: GridMap doesn't extend VisualInstance3D and therefore can't be hidden or cull masked based on VisualInstance3D.layers. If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Methods¶
void |
clear ( ) |
void |
|
get_bake_mesh_instance ( int idx ) |
|
get_bake_meshes ( ) |
|
get_basis_with_orthogonal_index ( int index ) const |
|
get_cell_item ( Vector3i position ) const |
|
get_cell_item_basis ( Vector3i position ) const |
|
get_cell_item_orientation ( Vector3i position ) const |
|
get_collision_layer_value ( int layer_number ) const |
|
get_collision_mask_value ( int layer_number ) const |
|
get_meshes ( ) const |
|
get_navigation_map ( ) const |
|
get_orthogonal_index_from_basis ( Basis basis ) const |
|
get_used_cells ( ) const |
|
get_used_cells_by_item ( int item ) const |
|
local_to_map ( Vector3 local_position ) const |
|
void |
make_baked_meshes ( bool gen_lightmap_uv=false, float lightmap_uv_texel_size=0.1 ) |
map_to_local ( Vector3i map_position ) const |
|
void |