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

Sprite shake when camera2d follow the character #78050

Closed
Pnsadeghy opened this issue Jun 9, 2023 · 4 comments
Closed

Sprite shake when camera2d follow the character #78050

Pnsadeghy opened this issue Jun 9, 2023 · 4 comments

Comments

@Pnsadeghy
Copy link

Pnsadeghy commented Jun 9, 2023

Godot version

4.0.3

System information

Windows 11

Issue description

I follow my character with Camera 2D and I activate position smoothing on camera.
When Camera follow the character, Character sprite shaking.
Event without smoothing, this will happen.

This is my camera code:

extends Camera2D

@export var following: CharacterBody2D

func _physics_process(delta):
	global_position.x = following.global_position.x
@AThousandShips
Copy link
Member

AThousandShips commented Jun 9, 2023

Have you tried using RemoteTransform2D? Or attaching the camera to the character directly? See also this about custom camera behaviour

Also have you set process_callback mode to CAMERA2D_PROCESS_PHYSICS, or update it from _process?

@Calinou
Copy link
Member

Calinou commented Jun 9, 2023

This is likely not a bug, see #73347 and godotengine/godot-proposals#6389.

@Pnsadeghy Please upload a minimal reproduction project to make this easier to troubleshoot.

@WhalesState
Copy link
Contributor

WhalesState commented Jul 31, 2023

please confirm if setting snap 2d transforms to pixel and snap 2d vertices to pixel enabled still produce this issue.

image

@AThousandShips
Copy link
Member

Closing due to lack of response, if you provide more information or an MRP this can be reopened

yndajas added a commit to yndajas/ludum-dare-54 that referenced this issue Sep 30, 2023
I enabled this in 42d4022 based on the assumption it was the same as
a Godot 3 setting mentioned in an article, but it seems to be causing
the sprite to have a shake effect when the camera is added. Disabling
it gets rid of the shake and produces smooth camera/player sprite
movement

[A Godot GitHub issue response] by @WhalesState pointed me in this
direction

[1]: godotengine/godot#78050 (comment)
yndajas added a commit to yndajas/ludum-dare-54 that referenced this issue Sep 30, 2023
I enabled this in 42d4022 based on the assumption it was the same as
a Godot 3 setting mentioned in an article, but it seems to be causing
the sprite to have a shake effect when the camera is added. Disabling
it gets rid of the shake and produces smooth camera/player sprite
movement

[A Godot GitHub issue response] by @WhalesState pointed me in this
direction

[1]: godotengine/godot#78050 (comment)
yndajas added a commit to yndajas/ludum-dare-54 that referenced this issue Oct 1, 2023
I enabled this in 42d4022 based on the assumption it was the same as
a Godot 3 setting mentioned in an article, but it seems to be causing
the sprite to have a shake effect when the camera is added. Disabling
it gets rid of the shake and produces smooth camera/player sprite
movement

[A Godot GitHub issue response] by @WhalesState pointed me in this
direction

[1]: godotengine/godot#78050 (comment)
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