I am trying to create a figgure of 8 algorithm for weapon bob, it makes a semi figgure of 8 shape but isnt exactly what i want,

attached to a camera:

```
using UnityEngine;
using System.Collections;
public class c : MonoBehaviour {
Vector3 currentCamPosition;
float m_PhaseX = 0f;
float m_PhaseY = 0f;
float m_Speed = 2f;
float m_x = 1f;
float m_y = 2f;
bool m_Invert = true;
bool m_InvertY = true;
void Start()
{
currentCamPosition = transform.position;
}
// Update is called once per frame
void Update ()
{
if (m_Invert)
{
m_PhaseX = Mathf.Lerp (m_PhaseX, m_x, Time.deltaTime * m_Speed);
if(m_PhaseX > m_x * 0.95)
{
m_Invert = false;
}
}
else
{
m_PhaseX = Mathf.Lerp (m_PhaseX, -m_x, Time.deltaTime * m_Speed);
if(m_PhaseX < -m_x * 0.95)
{
m_Invert = true;
}
}
if (m_InvertY)
{
m_PhaseY = Mathf.Lerp (m_PhaseY, -m_y, Time.deltaTime * m_Speed);
if(m_PhaseY > -m_y * 0.95)
{
m_InvertY = false;
}
}
else
{
m_PhaseY = Mathf.Lerp (m_PhaseY, m_y, Time.deltaTime * m_Speed );
if(m_PhaseY > m_y * 0.95f)
{
m_InvertY = true;
}
}
currentCamPosition.x = Mathf.Sin(m_PhaseX) / 1;
currentCamPosition.y = Mathf.Cos(m_PhaseY) / 1;
UpdateCam ();
}
public void UpdateCam()
{
transform.localPosition = Vector3.Lerp (transform.localPosition, currentCamPosition, Time.deltaTime);
}
}
```

Anyone got a working figgure of 8 algorithm that produces what i am looking for?