The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

When I move vertically, the border of my health bar dissapers sometimes, then it appears again. Also the sprite of crab "flashes". I would also make him smaller but flashing is getting worse. I have loaded texture as 2D pixel preset.

On web I found that maybe camera smoothing causes it but there is no difference if I have turned it on or off.

I tried to play with different rendering settings like FXAA, vsync etc. but I didn't noticed significant change.

When I make things very big then it is okay but that is not a solution. I guess it has something with scaling down?

enter image description here

enter image description here

Godot version 3.5
in Engine by (12 points)

1 Answer

+2 votes

The crab sprite likely flickers because it was severely downscaled, and does not have mipmaps available. There are 3 ways to fix this:

  • Resize the crab image in an image editor to a lower resolution. This is the recommended approach.
  • Select the crab image in the FileSystem dock, go to the Import dock, set Max Size option to a value greater than 0 (but lower than the sprite's resolution) then click Reimport. This will make Godot downscale the image on import, without affecting the original copy on disk.
  • Select the crab image in the FileSystem dock, go to the Import dock, enable Mipmaps then click Reimport. This is useful for games where the camera zoom changes significantly during gameplay, but it uses more memory.

I tried to play with different rendering settings like FXAA, vsync etc. but I didn't noticed significant change.

FXAA only has an effect on 3D rendering, not 2D. If it worked on 2D, then 2D graphics would become very blurry as FXAA is not designed to provide 2D antialiasing.

by (12,878 points)

Thank you, I downscaled my spritesheet in TexturePacker and works like charm! But do you know what to do with disappearing border of health bar? When it is small it even disappears in editor but it has to be this size...

That may be because your health bar is a child of the graphic so it shrinks in correspondence to its parent. Try rearranging the scene tree?

Sorry Sir, but I don't really understand.

My health bar is composed of base Control and ProgressBar itself:
explanation_1

Then I attach entire node to Crab:
explanation_2

Crab just sits in World which is just Node2D:
explanation_3

I don't use scaling anywhere.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.