Rotate around Object problem

Hi,
It is probably an easy problem that i cant see the solution, I worked on it along time and I cant see the problem.
I create an empty GameObject which called “Rotate Camera” put for him a script that called “Spincamera” and draged a GameObject that called “Main Camera”.

In “SpinCamera” I put this code:

using UnityEngine;
using System.Collections;

public class SpinCamera : MonoBehaviour {
	//this script for moving circley around the table
	
	public float RotateSpeed;
	private float Spin;
	private float ZoomSpeed;
	private float StartedFieldOf;
	private GameObject MainCemara;
	bool IsPause;
	// Use this for initialization
	void Start () {
	IsPause=false;
	Spin=transform.rotation.y;
	MainCemara=GameObject.Find("Main Camera");
	StartedFieldOf=MainCemara.camera.fieldOfView;
	ZoomSpeed=MainCemara.camera.fieldOfView/StartedFieldOf;
	}
	// Update is called once per frame
	void Update () {

		ZoomSpeed=MainCemara.camera.fieldOfView/StartedFieldOf;
		Spin=-Input.GetAxis("Horizontal")*RotateSpeed*ZoomSpeed;
		transform.Rotate(0,Spin,0);
	}
	
}

now the problem is the “Rotate Camera” Object spins not only around himself, like he should to do,
It spins around the main camera too, which make alot of mess.

please help me…

Up …
Please help me…

Up…
someone please help me!

Very, very weird script… Why do you need the fov of a camera to rotate? What are you trying to do?
It’s probably because Main Camera is inside RotateCamera, which will apply all rotations to RotateCamera unto Main Camera as well.

thank you for your reply, :slight_smile:
the FOV saves the field of view of the camera.
the camera has option to zoom in and out, for look better the view.
I wanted to do so if he zoom in it will slow it, and if it zoom out it will fast it.
How can I slove the Main camera problem?
I got a second camera which attached to RotateCamera and it spins alright around the RotateCamera GameObject…

please help me :S

why everytime i post something I have to do some much UP :S

i dont understand the problem, so I cant slove it by my one…

Bump…