Compile error that i cant fix

I have tried re writing it but I cannot fix this I have no clue I have the bracket there but am I missing something?

Screenshot of error

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour
{

    public GameObject target;
    public float followAhead;

    private Vector3 targetPosition;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        targetPosition = new Vector3(target.transform.position.x, transform.position.y, transform.position.z);

        if (target.transform.localScale.x > 0f) ;
        {
            targetPosition = new Vector3(targetPosition.x + followAhead, targetPosition.y, targetPosition.z);
        }
        else
        {
            targetPosition = new Vector3(targetPosition.x - followAhead, targetPosition.y, targetPosition.z);
        }


        transform.positon = targetPosition;

    }
}

Line 24 : if (target.transform.localScale.x > 0f) ;
There’s a semi-colon.

1 Like