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

Physics interpolation - streaking on unhiding nodes #60582

Closed
lawnjelly opened this issue Apr 28, 2022 · 1 comment
Closed

Physics interpolation - streaking on unhiding nodes #60582

lawnjelly opened this issue Apr 28, 2022 · 1 comment

Comments

@lawnjelly
Copy link
Member

lawnjelly commented Apr 28, 2022

Godot version

3.5 beta 2 to 4

System information

All

Issue description

When moving an interpolated node, if you hide it then later make visible, it will interpolate (streak) from the point at which it was made invisible, instead of matching the motion.

Steps to reproduce

Move an interpolated object continuously. Hide for a time, then make visible.

Minimal reproduction project

InterpolationSimpleTest.zip

Discussion

This is something @RPicster noticed while we were working on "beat invaders".
The minimal reproduction project confirms this is the case, the box should ideally be hidden as it moves back to the start then be reshown as it starts interpolating between 0 and 1.

An easy "fix" is to call reset_physics_interpolation() when unhiding nodes (either manually or adding this to core). However, this is not ideal because it will cause a subtle judder to a continuously moving object that is e.g. repeatedly shown and hidden.

The problem stems from my optimization in #45583 whereby set_transform() is not called to the VisualServer when objects are hidden, which saves a lot of processing for hidden objects. An obvious core fix is to disable this optimization for interpolated objects, so that the previous and current interpolated transforms still updated when hidden. This will cost some performance for a rare case, so I'll see if there's some way of reducing the cost of this.

@akien-mga
Copy link
Member

Fixed by #60584.

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

2 participants