how do I create a public floating variable that would rotating a object
I think you have some of your definitions mixed up. No such thing as a “floating variable”. I think you want is “How to create a GameObject reference that would orbit an object?” You can either parent the object in the hierarchy, or in your script do some calculations. There are many ways to calculate the rotation, not sure what you are doing exactly…
using UnityEngine;
using System.Collections;
public class SomeOrbit : MonoBehaviour {
public Transform floatingObject;
// Update is called once per frame
void Update ()
{
if (floatingObject != null)
{
float angle = Time.deltaTime * 100f;
floatingObject.RotateAround( this.transform.position, Vector3.up, angle );
}
}
}