Unity-Technologies / UnityPlayground

A collection of simple scripts to create 2D physics game, intended for giving workshops to a young audience
MIT License
870 stars 164 forks source link

Camera Follow : bound limits system #21

Closed Arche-san closed 5 years ago

Arche-san commented 6 years ago

Hey!

Some of my students asked for a way to bound the camera follow scripts with limits.

I've created a tool which generates a rectangle to set camera bounds for the current level. It could useful when scene contains begin/end spots. It should respect camera aspect ratio.

Here's an example of how it works (playmode is active) :

camerafollowbounds

If you think it's not too complicated for your students, you can integrate it into the main project. And I can improve it if it's not intuitive enough.

Cheers! :)

ciro-unity commented 5 years ago

Thanks for the great contribution, Arche-san! I merged it. I just made a couple of changes to the wording (like Left/Right instead of xMin/xMax, etc.). Just in time to make it to the documentation!