Quantcast
Viewing all articles
Browse latest Browse all 6

2D sprite flickering if mipmap disabled - UPDATED

Hello, i'm working on a 2D game. I've built it on Android and tested on several devices. Everything works fine in almost all the cases, except on just one device where some sprite looks like it has been chopped in pieces and mixed together without any order. The final effect is obviously awful! The Android version on that device is older but i've tried also on other devices with the same operating system version and everything looks fine. The suspicious fact is that this bug only shows on png that i have drawn on my own, so maybe i need to set some property before to import them in Unity. Anyway, all the png are already set to Sprite Mode: Single and Format: Truecolor. Can anyone help, please? UPDATE - The problem was about mipmaps, disabling them solved the problem. But now i have a strange flickering effect on some sprite borders... any idea? UPDATE 2 - This is my gameobject update function: void FixedUpdate () { if (bh_rotating) { transform.Rotate(Vector3.forward * 12f); bhDestroyDelay -= Time.deltaTime; if (bhDestroyDelay <= 0) main.DeleteAstro(this.gameObject, false); } if (beans) { amplitude = 0.8f; frequency = 1.0f; rigidbody2D.velocity = Vector3.right * 2; transform.Rotate(Vector3.forward * 2.5f); transform.position += amplitude * (Mathf.Sin(2 * Mathf.PI * frequency * Time.time) - Mathf.Sin(2 * Mathf.PI * frequency * (Time.time - Time.deltaTime))) * transform.up; } else { this.rigidbody2D.AddForce(-Vector2.right * 1 * Time.deltaTime * direction); this.transform.Rotate(Vector3.forward * direction * 0.5f); } } variables beans and bh_rotating start with false values, so in normal conditions the interesting part is the "else" statement

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>