Add a Debug-icon button next to the Lightbulb in the root row of the
Layers tree view (only when in embedded-game / in-app editor mode).
Clicking it toggles the local state `areCollisionsShownInEditor` in
SceneEditor and broadcasts a `set3DCollisionsShownInEditor` message
to the embedded preview frames via `previewDebuggerServer`.
The runtime debugger client receives the command and calls
`enableDebugDraw3D` on the edited instance container, reusing the
default color and depth-test settings.
Props are threaded through the `EditorsDisplay` interface, both
mosaic and swipeable-drawer displays, plus the LayersList story mock.
Expose the new 3D debug-draw via two GDevelop actions in the Debugger
Tools extension:
- `EnableDebugDraw3D` — enable/disable with explicit color (R;G;B)
and depth-test parameters. Mirrors the existing `EnableDebugDraw`
action used for 2D.
- `ToggleDebugDraw3D` — flips the current state, reusing the last
color and depth-test values stored on the instance container.
Both delegate to `RuntimeInstanceContainer.enableDebugDraw3D`.
Implement `renderDebugDraw3D` and `clearDebugDraw3D` on
DebuggerPixiRenderer. Wireframes are rendered as THREE.js meshes
attached to each object's 3D renderer object.
Supports the four Physics3D primitive shapes (Box, Sphere, Capsule,
Cylinder) including orientation (X/Y/Z), shape offsets, parent-scale
compensation, and the PhysicsCharacter3D bottom-origin adjustment.
Also supports the Mesh shape: each child mesh of the object's 3D
renderer is wrapped with a `THREE.WireframeGeometry` + LineSegments.
Async-loaded Model3D meshes are picked up automatically each frame,
and detached source meshes are pruned.
State is tracked in a `Map<RuntimeObject, DebugDraw3DState>` on the
renderer, with a per-frame `seen` set that disposes wireframes whose
owning object disappeared. CustomRuntimeObject children are visited
recursively so nested Physics3D objects are covered.
Wireframes opt out of raycasting (`mesh.raycast = () => {}`) so that
the community Raycaster3D extension doesn't crash on intersections
without normals.
Add `_debugDraw3DEnabled`, `_debugDraw3DColorHex` and
`_debugDraw3DDepthTest` to RuntimeInstanceContainer, plus a new
`enableDebugDraw3D(enabled, colorHex, depthTest)` method that mirrors
the existing 2D `enableDebugDraw`. When the settings change while a
draw is active, the existing wireframes are cleared so the renderer
rebuilds them with the new configuration.
`RuntimeScene.renderAndStep` calls `renderDebugDraw3D` each frame when
the flag is on — same hook point as the 2D debug draw.
The actual rendering is implemented in a follow-up commit.
Extract the field initialization from the constructor into a private
`_applyBehaviorData` helper, and reuse it for both the constructor
(full data) and the hot-reload hook `applyBehaviorOverriding` (diff
containing only changed fields). When any shape-related property is
present in the diff, the body is rebuilt via `recreateBody()`.
Previously the default `applyBehaviorOverriding` returned false, so
hot reload of Physics3D properties was silently dropped, forcing a
full restart of the app or closing and reopening the tab to see any
tweak made in the editor.
`onBehaviorUpdated` in CompactObjectPropertiesEditor was a no-op, so
editing behavior properties from the compact panel never propagated
to the in-app editor preview. Wire it to `onObjectsModified([object])`
like the other property edits in the same file. Debounced at 250ms
via `useDebounce` to avoid one hot reload per keystroke on fields.
Verify that a behavior's custom action whose events Create the object
passed as parameter (FireBullet-style) leads to the newly created
instances being picked in the calling scope, while a previously created
instance of the same object remains untouched.
Don't show in changelog
- This is an advanced, experimental feature which is subject to changes. It's in most cases not useful, unless you have a large game or low end devices for which controlling memory usage is important. It's mostly useful to delay loading of large custom objects.
- Objects can be configured so that its resources are not loaded when the scene is loaded. Instead, you can use an action to manually load the resources used by it. When the loading is done (this can be checked using a condition), the object can then be created.
Be careful: if an object assets are not loaded, it will be broken when displayed on screen.
- Three hooks are implemented:
- * **onEditorReady** — after the project is loaded and settings are
applied
- * **onPreviewStart** — before preview export/launch begins
- * **onPreviewEnd** — when the preview window is closed
- Auto-execution of hooked scripts requires user consent.
* Show a one-time dialog on the first hooked script trigger, asking the user to allow automatic script execution. The decision is then stored.
* Then, hooked scripts run silently without any prompts.