Sprites change their position while playing the scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cris Eldrimor
:warning: Old Version Published before Godot 3 was released.

Basically, i have two sprites which i want to use to draw a corner. Both sprites use the same texture, a black square, and i changed their scale to create two rectangles. When i put them together in the editor they fit perfectly.

but if i then play the scene the sprites change their position and they no longer make contact.

Why is this happening and how can i fix it?

:bust_in_silhouette: Reply From: volzhs

It looks a sub-pixel issue.
Try use_2d_pixel_snap option at Scene > Project Settings > Display.

Turning on that option didn’t solve the problem but i found that the boundaries of the sprite were bigger than the texture. By resizing the texture i managed to make them coincide. That solved the issue.

Cris Eldrimor | 2016-08-25 16:20