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

f749b39 re-introduced jitter in dev_scene_2d #283

Open
audeck opened this issue May 1, 2024 · 2 comments
Open

f749b39 re-introduced jitter in dev_scene_2d #283

audeck opened this issue May 1, 2024 · 2 comments
Labels
2D Issues concerning 2D scenes bug Something isn't working Investigating phantom camera Related to PhantomCamera nodes

Comments

@audeck
Copy link
Contributor

audeck commented May 1, 2024

Issue description

Not entirely sure why _player_visuals being top level matters here, but commit f749b39 introduces jitter into the default dev_scene_2d scene.

Steps to reproduce

  1. Clone the repository.
  2. Setup a Godot project inside the repository folder.
  3. Open dev_scene_2d.tscn.
  4. Disable follow_damping on the active PlayerPhantomCamera2D.
  5. Walk around.

(Optional) Minimal reproduction project

No response

@ramokz
Copy link
Owner

ramokz commented May 1, 2024

The top level bit is merely copying a function of what the smoothing addon does. It essentially just means that it further decouples the visual node from the physics node's movement.

I removed it because there was a strange bug where the visual node would have its position reset to Vector2(0, 0) on the first frame before going to its intended position. The issue that causes is that the damping PCam2D would move from that reset position to the actual position when running the game — i.e. the camera would trigger a pseudo-tween on start-up.

If you add _player_visuals.top_level = true to the _ready() function in the CharacterBody2D script, then on the PCam2D itself enable the damping, with a potentially increased amount, you should see the issue happening. This seems to only be occurring in 2D scenes, so my gut feeling says that it is likely an engine bug, but I am not sure.

Wanted to have damping on by default in the example scene, but also wanted to avoid that weird effect/bug, so stripped out the top level assignment as a result. Not ideal, but wanted it to look nice out of the box whilst trying to figure out what might be causing the issue.

@ramokz
Copy link
Owner

ramokz commented May 2, 2024

Seems to be solved in Godot 4.3

@ramokz ramokz added bug Something isn't working phantom camera Related to PhantomCamera nodes 2D Issues concerning 2D scenes Investigating labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2D Issues concerning 2D scenes bug Something isn't working Investigating phantom camera Related to PhantomCamera nodes
Projects
None yet
Development

No branches or pull requests

2 participants