This is the full script attached to the game object with only transform component as inspector
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
var b = false;
Debug.Log("Outside If condition :" + b);
if (b) ;
{
Debug.Log("Inside If condition :" + b); // How come this is executed ????
}
}
}
output