Get two message when passing over package

Hi All,

so upon driving over the package, i get both messages that the “package was picked up” and “Package Delivered”

i checked my package, is tagged as Package, and my customer is tagged as customer. for some reason i don’t have the same issue with the customer.

I’ve included the code. as i m not too sure what I’m doing wrong.
Thank you all for your help! :slight_smile:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class Amazon: MonoBehaviour

{

void OnCollisionEnter2D(Collision2D other)

{

    Debug.Log("ouch!");

}

void OnTriggerEnter2D(Collider2D other)

{

    Debug.Log("What was that?!");    

    if (other.tag == "Package")

    {

        Debug.Log("Package picked up");

    }

    if (other.tag == "Customer")

    {

        Debug.Log("Package Delivered");

    }

}

}

All good everyone i figured it out, i had the script on the car and on the package.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms