- Home /
Background & sprites are smearing towards the player during movement. Help determine the cause and solution?
Hi There! So I'm having a problem with character movement and my background. The background appears to be smearing(smudging) slightly in the direction of the character as it moves which looks really hard on the eyes. I have no idea what is really causing this but it might be the way I am moving the character.
I'm wondering what is causing this strange smearing movement effect and how I can fix it. Please keep the explanation noob-friendly for me and thank you very much in advance!
So here are the details:
The game is 2D and the player is constantly running in one direction and can jump.
I can't get a screenshot of the effect (So maybe its my eyes or my
computer?) but you can clearly see it when playing. Here is a link to the project so you can see what I am talking about yourself if my details don't help explain the effect. You will notice on the mountain tips and the clouds as you pass them. https://sites.google.com/site/benprojects50z/home/the-recycler-2dThe effect makes it look like parts of the background sprites (ex. mountain/clouds) smear(smudge) towards the player temporarily as he hops/walks by.
The camera is orthographic and is a child of the player.
The character uses the Unity character controller and has no rigidbody.
The character moves using the character motor and this script:
var moveSpeed : float = 10; var jumpSpeed : float = 25; var dead : float = 0.01; var player : GameObject; var anim : Animator; var gameOver = false; var countDownStyle : GUIStyle; var jump: AudioClip; var playerDead : AudioClip; private var moveDirection : Vector3 = Vector3.zero; private var motor : CharacterMotor; function Awake () { motor = GetComponent(CharacterMotor); } function Start(){ anim = gameObject.GetComponent(Animator); } function FixedUpdate () { if (RecyclerStartLevel.startG){ var controller : CharacterController = GetComponent(CharacterController); controller.Move(Vector3.right * (moveSpeed) * Time.fixedDeltaTime); anim.SetFloat("Speed",moveSpeed); motor.inputJump = Input.GetButton("Jump"); if (Input.GetKeyDown("space")){ audio.PlayOneShot (jump); anim.SetFloat("Speed",jumpSpeed); } } }
EDIT 1 This is an edited screenshot to show you what I'm pretty much seeing. http://i.imgur.com/9g79fRZ.png?1?8650
EDIT 2 So apparently the effect is only on my computer so I'll just have to see if I can change the scene setup I guess to make a work-around.
I don't see any smear effect. You should turn on vsync though. Also don't use FixedUpdate; that's only for physics and will randomly fail for input such as Get$$anonymous$$eyDown (since that's only true for the single frame when the key is down which may well not be during a physics update).
Thanks for looking into it! I'm not sure if VSync was on when I uploaded it to the site, but I've been fiddling around and Vsync is currently set to EveryVBlank so I presume that means its on now?
Also if I use Update ins$$anonymous$$d of FixedUpdate the jumping gets a bit jittery. I will look into avoiding its use when not using physics though and when to properly use it, I didn't know it caused Get$$anonymous$$eyDown to fail, Thanks!
I'm still having the problem though. It looks like somebody is using the motion blur effect from Gimp/Photoshop or smudging parts of the sprite as you jump by on my screen.
I'm not sure if I should be responding to this as an update in the question or as this comment.
Definitely don't see anything like that...I would assume it's something to do with your specific computer and/or graphics card and/or monitor.
Thank you! It definitely is my computer. I just tried it out on an older PC and the effect was not there. I also turned on Vsync, and stopped using FixedUpdate for the controller and that fixed a few problems. Thanks again, if you decide to post as an answer I'll be sure to 1+ it or accept it or whatnot!
Your answer
Follow this Question
Related Questions
Character Controller problem 0 Answers
Non-symmetrical Character walk left animation. 0 Answers
Making my 2d character's arm follow the mouse, scrpit not working, please help :c 1 Answer
How to make my character stop stuttering when walking down a slope? 2 Answers
CharacterController NullReferenceException dispite attached to object 1 Answer