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

Camera2D is not updating correctly when smoothing_speed is the default value. #23758

Closed
CowThing opened this issue Nov 16, 2018 · 4 comments
Closed
Milestone

Comments

@CowThing
Copy link
Contributor

Godot version:
Godot 3.1 e77afb8

OS/device including version:
Windows 10 64bit

Issue description:
Two bugs I noticed that seem to be related.

  • When resizing the game window the Camera2D doesn't center itself, even though it's set to be centered. This only happens when smoothing_speed is the default value of 5, it doesn't matter if smoothing is on or off, it happens either way. But when smoothing_speed is set to any other value it will update correctly and stay centered, even if smoothing is off.
  • When smoothing is on, smoothing_speed is the default value of 5, and using the dragging script provided below, the camera smoothing only updates while the mouse is moving. But when the smoothing_speed is any other value the camera moves smoothly as expected.

Neither of these bugs happened in 3.1 Alpha 2. You can open the project in that version to test as well.

The camera dragging script:

extends Camera2D

func _unhandled_input(event):
	if event is InputEventMouseMotion:
		if event.button_mask & BUTTON_MASK_LEFT:
			position -= event.relative

Steps to reproduce:

  • Run the project, try to drag the camera around. Also try resizing the window. The bugs described above will happen.
  • Change the smoothing_speed value to anything other than 5 and try running it again. The bugs stop happening.

Minimal reproduction project:
CameraBug3_1.zip

@bojidar-bg bojidar-bg added this to the 3.1 milestone Nov 17, 2018
@Lodugh
Copy link

Lodugh commented Dec 27, 2018

Had the same issue(Godot 3.1 alpha 4, Linux Mint 19) but it still happened for me, when I changed the smoothing_speed to 0. Though a smoothing_speed of 1 fixed it then.

@akien-mga
Copy link
Member

It would be great if someone could bisect what caused the regression. Apparently it worked fine in 3.1 a2, so it should be bisected between aec8ea4 (good, but test to confirm) and e77afb8 (bad).

@akien-mga
Copy link
Member

Given that it seems problematic with the default value, a potential culprit in that timeframe would be f2e5405.

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Feb 23, 2019
@akien-mga
Copy link
Member

Seems to work fine both in 3.1-stable and the current master branch, so I guess it was fixed and we forgot to close this issue (or I now misunderstand what the bug should look like).

@akien-mga akien-mga modified the milestones: 3.2, 3.1 Jan 9, 2020
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

4 participants