- Home /
Object blur on camera moving fast
I saw this question many times but could not get answer suitable,so posting Simple making a 2D runner game
Player movement:
void FixedUpdate ()
{
transform.Translate (speed * Time.deltaTime, 0f, 0f);
}
Camera script:
void FixedUpdate ()
{
targetPosition.x = player.transform.position.x + 3;
//transform.position = Vector3.Lerp (targetPosition, transform.position, 0.005f *Time.deltaTime);
transform.position = targetPosition;
}
camera can not be attached as child of player, as player will perform jump.
No matter what I change, camera always jerks, graphics looks like ghost and too blur.. any help or suggestion would be appriciated.
First, don't use FixedUpdate for this; only use it for physics. Just throw the code into Update(). Secondly, I don't see where you assign targetPosition so I would say just try doing this.
targetPosition = new Vector3(player.transform.x + 3, transform.position.y, -10);
If that doesn't work, you might be able to use SmoothDamp
Your answer
Follow this Question
Related Questions
camera Translate 1 Answer
camera transform not working when getting axis position 3 Answers
Camera moving in one direction? 2 Answers
Why my camera rotates around gameobject 1 Answer
How to make camera position relative to a specific target. 1 Answer