Skip to content

Hot reload edited behavior(s) in editor#8597

Open
Bouh wants to merge 2 commits into
masterfrom
hot-reload-edited-behavior
Open

Hot reload edited behavior(s) in editor#8597
Bouh wants to merge 2 commits into
masterfrom
hot-reload-edited-behavior

Conversation

@Bouh
Copy link
Copy Markdown
Collaborator

@Bouh Bouh commented May 13, 2026

This PR aim to refresh the editor when the behaviors properties are changed, but not too often thanks to the debounce.

1before

This PR is a first step with the Physics3D behavior that I need to be done before the next PR about seeing 3D collision shapes from the physics 3D behavior inside the editor and in-game, drafted here: (URL to come in a few minutes :) )

I wasn't sure if the good thing was to use updateFromBehaviorData that is empty and never used.
So I found an updated test on https://github.com/4ian/GDevelop/pull/8553/changes so I searched and found how few capabilities behavior do with applyBehaviorOverriding(diff). I hope this is the way?

Bouh added 2 commits May 13, 2026 21:43
`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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant