BoxCollider2D ignores 'Is Trigger' when object is set as a Child?

My 1st attempt with a 2D Platform Game. My Player Character and Melee Enemy work as expected. The Player Character has a Rigidbody 2D set as Dynamic. The Melee Enemy just a Box Collider 2D set as a Trigger. Everything works well until I place the Melee Enemy within an EnemyPatrol as a Child. The Enemy now patrols up and down as you would expect but the Box Collider 2D becomes ‘Rigid’ and ignores the ‘Is Trigger’ Setting. So the Melee Enemy just pushes up against the Player Character and becomes ‘stuck’.

I cannot see how the attached script that appears to be working ok has corrupted the Box Collider setting?

Very frustrating and after a day of playing with the settings and searching online still no solution.

Any suggestions on how to resolve would be great… thanks.

using UnityEngine;

public class EnemyPatrol : MonoBehaviour
{
    [Header("Patrol Points")]
    [SerializeField] private Transform leftEdge;     //Left hand patrol point for Goblin
    [SerializeField] private Transform rightEdge;    //Righthand patrol point for Goblin

    [Header("Enemy")]
    [SerializeField] private Transform enemy;

    [Header("Movement parameters")]
    [SerializeField] private float speed;           //Speed field to control Goblin movement
    private Vector3 initScale;                      // Initial position recorded
    private bool movingLeft;

    [Header("Idle Behaviour")]
    [SerializeField] private float idleDuration;        // Goblin waits at end of each patrol before turning
    private float idleTimer;

    [Header("Enemy Animator")]
    [SerializeField] private Animator anim;



    private void Awake()
    {
        initScale = enemy.localScale;  //Saves Enemy position at start of game
    }

    private void onDisable()      //when patrol gets stopped moving animation will stop
    {
        anim.SetBool("moving", false);
    }

    private void Update()
    {
        if (movingLeft)
        {
            if (enemy.position.x >= leftEdge.position.x)   //has the goblin reached the left side of patrol
                MoveInDirection(-1);
            else
                DirectionChange();
           
        }
        else
        {
            if (enemy.position.x <= rightEdge.position.x)    //has the goblin reached the right side of patrol
                MoveInDirection(1);
            else 
                DirectionChange();
           
        }
    }
    private void DirectionChange()      // allows Goblin to change direction
    {
        anim.SetBool("moving", false);    // stop walking animation if Goblin stops moving

        idleTimer += Time.deltaTime;

        if(idleTimer >idleDuration)
            movingLeft = !movingLeft; //negate value ! makes the direction change
    }




    private void MoveInDirection(int _direction)
    {
        idleTimer = 0;
        anim.SetBool("moving", true);   //sets animation to moving

        //Goblin to face in the correct direction
        enemy.localScale = new Vector3(Mathf.Abs(initScale.x) * _direction, initScale.y, initScale.z);



        // Move in that direction
        enemy.position = new Vector3(enemy.position.x + Time.deltaTime * _direction * speed, enemy.position.y, enemy.position.z);
    }

}

!(http://“C:\Users\Jack Bowdery\Desktop\Patrol.png”)

Try delete the collider you THINK is causing the problem. It’s probably something else happening.