I am making a game, something like Ketchapp’s Twist. How can I make the camera rotate along with the player only on the Z axis? I did this to make the camera follow the player’s position -
public GameObject player;
private Vector3 offset;
void Start()
{
offset = transform.position - player.transform.position;
}
void Update()
{
Vector3 pos = player.transform.position + offset;
transform.position = new Vector3(pos.x,transform.position.y,pos.z);
}
But an error pops up when I try the samre thing with the rotation. Anyone have suggestions?
P.S. If you can make the platforms on which the player moves rotate instead of the camera, it’s fine too.