Skip to content

Bug fix - joystick resets position when used inside layout containers#105

Open
uoslider-wq wants to merge 1 commit into
MarcoFazioRandom:Mainfrom
uoslider-wq:fix-layout-container-reset-position
Open

Bug fix - joystick resets position when used inside layout containers#105
uoslider-wq wants to merge 1 commit into
MarcoFazioRandom:Mainfrom
uoslider-wq:fix-layout-container-reset-position

Conversation

@uoslider-wq
Copy link
Copy Markdown

@uoslider-wq uoslider-wq commented Mar 29, 2026

Fixes #106

I have a joystick inside a bunch of layout containers in my game's UI.
When it starts up everything is in the correct spot.
I press on the joystick and everything is good.
I release the joystick and it moves position even though I'm in mode "Fixed".

The problem is that _base_default_position and _tip_default_position are assigned values in @onready which is before the containers have put them in their correct positions.

The fix is to delay the value assignment until after the containers have finished moving them using call_deferred. The deferred function also calls _reset() ensuring it runs with the correct positions already captured and not before.

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.

Bug - joystick resets position when used inside layout containers

1 participant