Base ShapeCast2D providing thread-safe, immediate collision caching. Under threaded physics (physics/2d/run_on_separate_thread=true), calling Godot's built-in collision methods outside _physics_process can cause thread safety issues or return stale data. This base class manages a thread-safe cache populated safely during the physics process frame.
Source: addons/grid_placement/base/placement_cached_shape_cast_2d.gd
Syntax
class PlacementCachedShapeCast2D extends ShapeCast2DMembers
| Name | Kind | Summary |
|---|---|---|
resolve_placement_dependencies | Method | |
resolve_placement_runtime | Method | |
cached_is_colliding | Property | |
cached_colliders | Property | |
cached_colliders_snapshot | Property | Read-only view of the last cached colliders. Unlike cached_colliders this never refreshes the cache, so a reader that reports the cache cannot change it: telemetry and failure evidence describe the hover the player saw, not the one a fresh cast would find now. |
cached_global_transform | Property | Tracks the global transform at which the collision cache was last updated. |
is_in_physics_process | Method | |
force_shapecast_update | Method | |
get_cache_age_frames | Method | |
is_cache_stale | Method | |
is_cache_populated | Method |
Tutorials built on Grid Placement
- Godot multiplayer grid placement: one host, four sessions
- Godot 2D grid building system: paint, place, save
- Godot 3D grid building system: the runtime loop
- Godot 4 grid-building plugins: build mode vs editor tools
- 3D room placement in Godot: build rooms and stack storeys
- 3D grid placement in Godot 4: full setup tutorial
- Snap to a TileMap in Godot: 2D grid placement
- How to make a farming system in Godot
- How to snap objects to a 3D grid in Godot