Reply To: Camera Issue from Game World Chapter

Home Forums Books Mastering Unity 2D Game Development Camera Issue from Game World Chapter Reply To: Camera Issue from Game World Chapter

#10035

What I’d suggest is downloading the source for the book and comparing your implementation to the final output.

I’m guessing something is amis with your setup as in the final project you don’t need to apply such a fix.

Alternatively, zip your assets folder and send me a link and I’ll have a look at what is going on.

The bounds of the viewable area are defined by the dimensions of the background texture (min / max) and the camera bounds (resolved using ViewportToWorldPoint)

Then in the final part of the FixedUpdate function, we simply clamp the final position of the camera (which follows the player) within these values.

 

Hope this helps.

Simon (Darkside) Jackson
@SimonDarksideJ