Smart Camera for Unity 2D Platfomers

Nerevarine

Incarnate
I made my own Camera logic scripts which I have uploaded to Github for anyone to use in their project (2D platformer/sidescroller)

*github.com/Sunil95/Unity-2D-Platformer-Smart-Camera-Implementation

Please leave a feedback, I shall update it further as much as possible.. Right now its pretty basic, but much more precise than the standard Unity controller..

Here's a minor description for it
Code:
Generic camera controllers/Unity Inbuilt controller simply track the position and movement of the player controller. However this is very imprecise and can look quite odd in fast paced platformers.
The smart camera, uses a rectangular TRAP that encases the player character. The player cannot move out of this TRAP. The camera ONLY starts moving when the player hits the boundaries of the TRAP. This gives a small room for the player to move around without affecting the camera..

Ill keep updating this thread, should anyone require assistance

Ive also attached simple demoscene for anyone to fiddle around.. Right now, my code is very messy, so take note before editing
 
Last edited:

Anorion

Sith Lord
Staff member
Admin
nice. Looked in the code for the cam.
the bounding box idea is cool, that's probably a good approach, nothing like that here
Scripts/Controllers - Unify Community Wiki
only suggestion is add more comments explaining the script
 
Top Bottom