- Home /
Blurry movement problem
I am trying to make a side scroller, and my approach so far has been to keep the player in a fixed position and move the environment by him. Within a FixedUpdate, I am merely doing a very simple
foreach (GameObject o in segments){
o.transform.Translate(scrollSpeed*Time.fixedDeltaTime);
}
This, however, causes everything to be very blurry, small objects in particular, such as stars etc.
I tried the following without any success in removing the blurriness:
moving the loop in a simple Update method + using Time.deltaTime or Time.smoothDeltaTime
making the player move as the world is stationary, with the camera following the player
I should mention that it looks fine when paused. The problem is only with it moving by at high speeds.
I'm currently out of ideas on what I could try. Is it possible to make the objects not look blurred when moving? Any tips are welcomed.
Hi, I'm having the same problem. I followed this tutorial In fact my code for moving the objects is the same
public class PlayerController : $$anonymous$$onoBehaviour {
public float speed;
private bool facingRight = true;
private Animator animator;
void Start(){
animator = GetComponent<Animator>();
}
void FixedUpdate(){
float moveHorizontal = Input.GetAxis ("Horizontal");
rigidbody2D.velocity = new Vector2 (moveHorizontal * speed, rigidbody2D.velocity.y);
if((moveHorizontal > 0 && !facingRight) || (moveHorizontal < 0 && facingRight))
flip();
animator.SetFloat("speed", $$anonymous$$athf.Abs (moveHorizontal));
}
private void flip(){
facingRight = !facingRight;
//La definicion de una variable auxiliar(scale) es necesaria para modificar localScale
Vector3 scale = transform.localScale;
scale.x *= -1;
transform.localScale = scale;
}
}
But when my object take high speeds it became very blurry