- Home /
Screen glitch on camera move
So, what I am doing is, I have several GameObjects lined up on the screen and with my cursor I am moving above that (It is in 2D mode, but they all have slightly different z-levels. That is normal of course for render order here). The camera has a sript attached that sets the position of it on every Upadate() to that one of the target (the cursor). The cursor is moving with Vector3.MoveTowards to make a smooth movement from grid to grid.
So now, why could it be tearing the screen so badly here? That does not even seem like a VSync error, it is just... weird. I do not think that it is a hardware fault, since that does not happen in any other software I use. Maybe it is something about the settings I missed?
I have a attached a very small (in file--size) video here so you can see what I mean: http://www37.zippyshare.com/v/SjhQaEci/file.html
This is only happening in the standalone build, not in the editor, and only in fullscreen.
Answer by Dudicus · Jul 11, 2017 at 02:19 AM
This is a rendering problem. I think that sometimes when different objects temporarily get on the same Z level in 2D they "blend" together in weird ways. Make sure no 2 objects are ever on the same Z level when they would be touching each other. Your mouse movement script should NEVER move objects Z level in this instance. (I'm sorry if I was slightly redundant but I felt like this could possible take a lot of explaining.)
(Damn, I accidentally deleted my old answer, so here I try again)
Excuse my lack of understanding, but... what? Could you explain that some more please?
What do you mean with "mouse movement"? The cursor is a GameObject that moves around by $$anonymous$$eyBoard input. It moves with Vector3.$$anonymous$$oveTowards (containing a change in z-axis, yes, but it never touches any other object). The other tiles on the screen are mostly adjacent to each other in the z-axis, yes. Like you would actually think how a 2D-game should be, a flat plane. And they always remain static there.