1
\$\begingroup\$

I made a floating platform in Unity which has a propeller movement animation. I attached a script I wrote to the game object that adds slight vertical and horizontal movement using the game object transform.position. This is creating some weird artifacts at the top of the sprite, but only when the movement code is active. When I don't move the platform and just leave it still to animate there are no artifacts.

Gameplay:

gif of gameplay

Sprite Import Settings:

sprite import settings

Sprite Renderer:

sprite renderer settings

Camera Settings:

camera settings

Resolution:

resolution settings

\$\endgroup\$
8
  • \$\begingroup\$ Looks like you're drawing the sprite at a scale that's not quite an integer ratio of screen pixels to sprite texels. So in motion, sometimes your outline spans more pixels vertically, causing it to be drawn thicker for a frame. Can you show us how you've set up the sprite texture, its import settings, its renderer, the camera, and your display window size? \$\endgroup\$ – DMGregory Apr 14 '20 at 22:01
  • \$\begingroup\$ @DMGregory Added! Let me know if I missed anything. One thing I did leave out is that I'm scaling the platform by 2 in the X and Y. \$\endgroup\$ – Christopher Perry Apr 15 '20 at 0:15
  • \$\begingroup\$ Still missing the transform on your sprite renderer, and the dimensions of your window. \$\endgroup\$ – DMGregory Apr 15 '20 at 0:17
  • \$\begingroup\$ @DMGregory I'm not sure what you mean by window. Size of the game view? I updated the sprite renderer pic to include the transform. \$\endgroup\$ – Christopher Perry Apr 15 '20 at 0:21
  • \$\begingroup\$ Yep. To get a perfect integer ratio of screen pixels to sprite texels, we need to know the exact size your game will be displayed on screen. \$\endgroup\$ – DMGregory Apr 15 '20 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.