2D Platformer Camera?

I am currently in the process of making a 2D/3D side scroller. However I am having problems with adjusting the camera settings. I currently have a smoothfollow camera control attached to a camera. It follows the character but I need it to follow from the right rather than behind/above the character. I know this can probably be sorted in the code but I’m completely useless when it comes to code so I cannot tell where. Anyone have any suggestions or alternative methods to get the side scrolling camera?

Thanks in advance :slight_smile:

I would not use the smoothfollow code. It’s made for FPS cameras.

A first approach would be a camera that follows you character ‘n’ coordanate (where n is orthogonal to the direction your character will walk).

something like this (not tested):

public var mainChar:MyCharacter; // setup in project
private var smoothForce:float;

function Update(){
    // smooth follow
    transform.y = (mainChar.transform.y - transform.y) * Time.deltaTime * smoothForce;
}

cheers,