I have AnimatableBody2D - let’s call it Moving Platform.
This Moving Platform is moved by RemoteTransform2D of some CharacterBody2D - let’s call it Origin Body.
On Moving Platform stands another CharacterBody2D - let’s call it Character.
If Sync to Physics is checked then Character is in sync with Moving Platform, but both are a little delayed in relation to Origin Body.
If Sync to Physics is unchecked then Moving Platform is in sync with Origin Body but of course Character is 1 frame behind.
Found and awful workaround.
It works correctly when I do this:
Introduce another CharacterBody2D called HiddenDummyOriginBody
Make it behave like Origin Body
Make Moving Platform move via RemoteTransform2D in HiddenDummyOriginBody
Make Origin Body move via RemoteTransform2D in Moving Platform (important)
This way all three - Origin Body, Moving Platform (with sync enabled) and Character standing on Platform are in sync.
Of course HiddenDummyOriginBody is 1 frame ahead of everything but it’s just hidden dummy object and we don’t care about it.
So the solution is to reverse RemoteTransform2D - make CharacterBody2D Origin Body copy transform of AnimatableBody2D Moving Platform instead of Moving Platform copy Origin Body. And to do this we need to introduce another CharacterBody2D to be actual source and logic of all the movement.
Works but seems like big boilerplate and just does not feel right.
There should be some better solution.