// Update is called once per frame void Update() { bool goingUp = ballMovementScript.GetGoingUp(); if (goingUp && follow) { transform.position = (ballTransform.position + relativePositionToBall); transform.position = new Vector3(initialPositionX, transform.position.y, transform.position.z); } }