Game Development Community

Camera Stops Updating/refreshing

by CharlesL · in iTorque 2D · 10/15/2012 (11:58 am) · 7 replies

This is probably on the forum somewhere, but I can't find anything on it. The camera matches the X position of the player every frame, but after a certain point, the camera will stop refreshing/updating so that everything blurs together. Any idea what this is?

#1
10/15/2012 (6:23 pm)
When that happens, you are probably outside of a region where you have an image as your background. It's not that the camera has stopped updating, it's that it has nothing to update at that point, other than your player character. So you're seeing trails/blurs where your character and backgrounds were because there isn't anything to draw over it.

You can constrain your player character by defining its world limits within your background image and then setting its Limit Mode to Clamp or Bounce or something like that.
#2
10/16/2012 (5:16 am)
Actually I already have a large image in the background that goes to the edge of the platform, and it stops refreshing long before the edge of the image.
#3
10/16/2012 (8:18 pm)
Can you post a screenshot so we can see exactly what the problem looks like?
#4
10/18/2012 (1:07 pm)
screenshot:
3.bp.blogspot.com/-5yLit8MI6A0/UIBiDciIaJI/AAAAAAAAAE0/8d6_-caJCcs/s1600/screenshot.png
Also, I noticed, it stops refreshing at the camera's edge in the editor(I'm changing the position in a script).

Example:
Editor:
|-----------------|
| |---|
| |---|<-camera |
|-----------------|
Game
|-----------------|
| ---|<-stops refreshing here (lines up with edge of camera).
|
|-----------------|
#5
10/20/2012 (10:44 pm)
Yeah, that's exactly what you see when the background doesn't fill the entire area seen by the camera. Double the width and height of your background and you shouldn't see this happen.
#6
10/22/2012 (1:03 pm)
This is a different problem. I have set the size of the background to about 10 times the size of the camera.
#7
11/12/2012 (4:00 pm)
I figured out a work-around - I parent the camera to an object which matches the players x location. Now I have a problem, the camera shakes back and forth really fast, is there something to do to fix this?