// Update is called once per frame void Update() { if (Pauser.IsPause()) { return; } transform.position = new Vector3(transform.position.x, Mathf.Sin(Time.timeSinceLevelLoad * speed) * length, transform.position.z); }