0 votes

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?

in Engine by (12 points)

1 Answer

0 votes

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

by (9,752 points)

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.

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 webmaster@godotengine.org with your username.