Is it possible to keep the player offset in place on the screen independent of resolution?

Okay, so I have a camera I’ve been building for a 2D sidescrolling game. The player needs to stay slightly off to the left - like an original Gradius game:

alt text

The camera moves freely from the player, and needs to stay that way. At the moment, I just can’t get the offset working right - I keep trying the various screen conversions but I’m not sure what will work - here is my code:

using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour {

	public Transform TrackTarget;
	public float dampTime = 0.15f;
	public float OffsetFloat = 0.05f;
	public bool Ready = false;
	private Vector3 velocity = Vector3.zero;
	private Vector3 TargetOffset = Vector3.zero;

	
	void Start()
	{
		TargetOffset = (camera.WorldToViewportPoint(TrackTarget.position * OffsetFloat));

		Vector3 point = TrackTarget.position + TargetOffset;
		Vector3 Destination = new Vector3(point.x, point.y, transform.position.z);				
		transform.position = Destination; 
	}
	
	void FixedUpdate () {
		TargetOffset = (camera.WorldToViewportPoint(TrackTarget.position * OffsetFloat));
		
		if (Ready) {
			if (TrackTarget)
			{
				Vector3 point = TrackTarget.position + TargetOffset;
				Vector3 Destination = new Vector3(point.x, point.y, transform.position.z);				
				transform.position = Vector3.SmoothDamp(transform.position, Destination, ref velocity, dampTime);
			}
		}
	}
	
	void LateUpdate()
	{
		if (Ready) {
			Vector3 CameraPosition = transform.position;
			CameraPosition.z = -10.00f;
			transform.position = CameraPosition;
		}
	}
}

My two cents on this, get the boundaries of the screen on Start, then convert the positions to world position, modify the position by the ratio you want to be inside the screen, then clamp the ship x and y positions.

Here for converting to world position : Calculating 2D camera bounds - Unity Answers

then you create some game object that you attach to the camera so that they follow.

Finally, you clamp the ship position using those 4 objects.