I made this script instance but I get this error: Assets / Prefab / PrefabSpawner.cs (15,12): error CS0135: `PrefabPosL 'Conflicts with a declaration in a child block

using UnityEngine;
using System.Collections;

public class PrefabSpawner : MonoBehaviour {

public GameObject Prefab;

private bool PrefabPosL = true;

private bool PrefabPosR = false;

// Use this for initialization
void Start ()
{
    if(PrefabPosL = PrefabPosR)
        {
        Vector3 PrefabPosL = new Vector3(Random.Range(-2, 2), transform.position.y, transform.position.z);

        Instantiate(Prefab, PrefabPosL, transform.rotation); 
        }
    else
        {
        Vector3 PrefabPosR = new Vector3(Random.Range(2, 2), transform.position.y, transform.position.z);

        Instantiate(Prefab, PrefabPosR, transform.rotation);
        }
}

// Update is called once per frame
void Update ()
{

}

in future, please format ALL of the code so that error messages are accurate. in your example, the error is stated as line 15, but it’s actually line 10 as posted:

 if(PrefabPosL = PrefabPosR)

this is not testing if they are the same - that’s

 if(PrefabPosL == PrefabPosR)

what you’ve tried to do is assign the value of PrefabPosR to PrefabPosL and then the if tests whether it’s true or not…