Post by Bobby Elser on Apr 12, 2017 5:34:39 GMT
Nice forum! Thanks for setting it up. I love PC2D, I'm glad to have a space dedicated to talking about it outside of its one Unity forum thread!
My game is essentially an infinite runner, the character moves in one direction for a very long time. I've decided to periodically shift all of the contents of the scene to put the player character back at the scene origin so that the player doesn't eventually run out to a distance where floating point errors occur.
I'm using three Pro Camera 2D extensions: Repeater, Forward Focus, and Pixel Perfect.
The Repeater seems unhappy that I've shifted the object it repeats, because it still remembers the original starting position of that object but I've shifted it (and all of the clones that the Repeater created) by an arbitrary amount. It's necessary to shift them, because if I don't then the character appears to skip forward or backward. I haven't tried keeping the repeated objects in place and shifting the camera by some multiple of their size, but even if that works it wouldn't play very well with the rest of my code. Is there a good way to shift the clones created by Repeater without breaking it?
Forward Focus works pretty well, but right after the shift there's a noticeable wobble in the character's position on the screen. I use ProCamera2D.MoveCameraInstantlyToPosition() to shift the camera exactly as much as I'm shifting the character, but something is causing the influence to fluctuate slightly whenever this happens. I'm guessing there's some kind of slight difference in the final positions of the camera and target, or perhaps Forward Focus is registering the shift of its target as movement and factors that into its influence. I tried removing Pixel Perfect to see if that might have been having some subtle effect, but that didn't change anything. Is it possible to shift the camera and target together without Forward Focus noticing?
Here's a gif of both problems in action (the Forward Focus problem isn't as noticeable with the game view this small, but it's there): imgur.com/vxkjarM
My game is essentially an infinite runner, the character moves in one direction for a very long time. I've decided to periodically shift all of the contents of the scene to put the player character back at the scene origin so that the player doesn't eventually run out to a distance where floating point errors occur.
I'm using three Pro Camera 2D extensions: Repeater, Forward Focus, and Pixel Perfect.
The Repeater seems unhappy that I've shifted the object it repeats, because it still remembers the original starting position of that object but I've shifted it (and all of the clones that the Repeater created) by an arbitrary amount. It's necessary to shift them, because if I don't then the character appears to skip forward or backward. I haven't tried keeping the repeated objects in place and shifting the camera by some multiple of their size, but even if that works it wouldn't play very well with the rest of my code. Is there a good way to shift the clones created by Repeater without breaking it?
Forward Focus works pretty well, but right after the shift there's a noticeable wobble in the character's position on the screen. I use ProCamera2D.MoveCameraInstantlyToPosition() to shift the camera exactly as much as I'm shifting the character, but something is causing the influence to fluctuate slightly whenever this happens. I'm guessing there's some kind of slight difference in the final positions of the camera and target, or perhaps Forward Focus is registering the shift of its target as movement and factors that into its influence. I tried removing Pixel Perfect to see if that might have been having some subtle effect, but that didn't change anything. Is it possible to shift the camera and target together without Forward Focus noticing?
Here's a gif of both problems in action (the Forward Focus problem isn't as noticeable with the game view this small, but it's there): imgur.com/vxkjarM