Moving a camera along its y axis when player GameObject scales

I am making a ball-roller game where the player (ball) gets larger, the more objects it collects.

I would like to move my camera along its local y axis so that it gets farther away from the player, as the player Game Object scales up.

Here is my camera controller now:

public class CameraController : MonoBehaviour {

	public GameObject player;
	private Vector3 offset;

	// Use this for initialization
	void Start () {
		offset = transform.position;
	}
	
	// Update is called once per frame
	void LateUpdate () {
		transform.position = player.transform.position + offset;
		transform.position.y = transform.position.y + player.transform.localScale.x;
	}
}

This gives me the error:

Assets/Scripts/CameraController.cs(17,27): error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position’. Consider storing the value in a temporary variable

I am new to coding, and to Unity, so forgive my ignorance! I feel like this is probably a relatively simple syntax problem…? Any help would be appreciated. Thanks!
-Mike

Thanks! Your code didn’t account for the “offset” position, shown in my first example, but it let me along the right path.

Here’s some more context: In my game, the player rolls around the screen and collects “food” items. Every time you collect a food item, the player scales. See a preview video of this here:
https://twitter.com/weheartgames/status/710656378969272320

I decided that the easiest thing to do would be to increment the camera’s position using the PlayerController’s “count” variable, which tracks how many items you’ve collected. So I’ve come up with the following code:

public GameObject player;
	private Vector3 offset;


	// Use this for initialization
	void Start () {
		offset = transform.position;
	}
	
	// Update is called once per frame
	void LateUpdate () {
		//transform.position = player.transform.position + offset;

		transform.position = new Vector3(player.transform.position.x + offset.x, player.transform.position.y + offset.y + PlayerController.count, player.transform.position.z + offset.z - PlayerController.count);
	}

This works for me (adding 1 to y and subtracting 1 from z), because the camera is looking down at the player at exactly a 45 degree angle:

I would love to be able to move the camera on its local axis (moving its local z axis, not the y axis as this posts title implies; I just had the wrong axis in mind).
But I would love to be able to apply the transform to just a single, local axis, is that possible?

i don’t know what exactly happen in your project but this code will make camera fallow the player & offset the y transform position according to the scale increment of the player :

 void LateUpdate ()
 {
    transform.position = new Vector3(player.transform.position.x,
    player.transform.position.y+ player.transform.localScale.x,
    transform.position.z);
  }