Sprite randomly becomes blurry

My character sprite randomly becomes blurry. It doesn’t happen all of the time though.

Player character moves at 2.5px a frame. I’m converting position vector values to int before feeding them to spriteBatch.Draw().

I also have a 2d camera system that uses a transform matrix to scroll the scene. That position value for that is also incremented by 2.5px a frame and, again, I’m converting the camera’s position vector values to int before feeding them to the Matrix.CrateTanslation() method.

Lastly, my spriteBatch.Begin call has SamplerState.PointClamp set.

So… I’m kind of at a loss. I know you will see this behavior when not casting sprite positions to int (if they are being increased/decreased by a float value), but I really have all of the bases covered there. The other thing is that it only happens when player sprite is moving, which leads me to believe it’s related to the increasing/decreasing by the float value. Any thoughts?

Can you post code please?

Actually, I just fixed it. Code for one particular animation was messing things up. Thanks for being willing to help though! :slight_smile:

Would be nice if you could share the solution for future searchers perhaps?