Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] ViewportContainer unexpectedly turns off physics interpolation #92150

Closed
lawnjelly opened this issue May 20, 2024 · 1 comment
Closed
Assignees
Milestone

Comments

@lawnjelly
Copy link
Member

lawnjelly commented May 20, 2024

Tested versions

3.6 from beta 3 (2D physics interpolation)
Doesn't occur in 3.5 and prior to 2D physics interpolation

System information

All

Issue description

In a physics interpolated game, when using ViewportContainer, objects below the ViewportContainer are unexpectedly not physics interpolated.

This issue was isolated from #91918 (and found by @elvisish )

Steps to reproduce

  • Create ViewportContainer
  • Create physics interpolated gameplay below the above node
  • Switch on physics interpolation in project settings
  • See no physics interpolation

Minimal reproduction project (MRP)

Press return to toggle on / off the physics interpolation mode of the ViewportContainer.
viewport_interpolation_bug.zip

Discussion

Unsure whether to class this as a bug or documentation as yet, but probably something I can fix engine side to make more sensible.

The problem stems from 2D physics interpolation, because Control now defaults to PHYSICS_INTERPOLATION_MODE_OFF. This is because user interface elements typically are not desired to interpolate (they can still be interpolated but they must be explicitly set to e.g. PHYSICS_INTERPOLATION_MODE_ON or PHYSICS_INTERPOLATION_MODE_INHERIT).

In the particular case of ViewportContainer (and possibly other controls containing a viewport with an interpolated scene), this has the side effect of propagating the physics_interpolation flag to be OFF for the scene tree branch below the viewport.

There may be a simple fix to this (rather than documentation), such as defaulting Viewport itself to PHYSICS_INTERPOLATION_MODE_ON rather than PHYSICS_INTERPOLATION_MODE_INHERIT, thereby resetting physics interpolation to the default state below any viewport.

@lawnjelly
Copy link
Member Author

Fixed by #92152.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant