Camera follow character around a sphere

Heya I am working on a game similar to this one:

I have a character which I can move around a sphere, now I want the camera to follow the player, meaning the camera needs to rotate around the sphere and always show the player. When making the camera a child of the player this works fine, however that is not an option anymore since the camera needs some additional features nor does it show the rotation of the player.

therefore I am aksing myself how to accomplish a camera movement script which would follow the player around a sphere, all scripts I tried sofar do not move around a sphere, therefore the character could disappear on the back of the sphere…

Any ideas ?

Try this -

using UnityEngine;
using System.Collections;

public class FollowPlayerCSharp : MonoBehaviour
{
	public Transform target;
	public float distance;
	

	void Update()
	{
		if (!target)
		{
			// Search for object with Player tag
			var go = GameObject.FindWithTag("Player");
			// Check we found an object with the player tag
			if (go)
			// Set the target to the object we found
			target = go.transform;
		}

		if (target)
			transform.position =new Vector3(target.position.x, target.position.y+25, target.position.z - distance);
	}
}

Hopefully this will do what you need.

:slight_smile:

@deathripper Did you manage to find an answer to your question? I am facing the same issue.