GoalBallPlayerMovementV1.Update C# (CSharp) Method

Update() private method

if goback is true, then it will move it back to its origonal position.
private Update ( ) : void
return void
    void Update()
    {
        if (goBack)
        {
            if (Mathf.Abs(Vector3.Distance(currentPosition, gameObject.transform.position)) < 1)
            {
                goBack = false;
            }
            float step = speed * Time.deltaTime;
            transform.position = Vector3.MoveTowards(transform.position, currentPosition, step);
            
        }
    }
GoalBallPlayerMovementV1