del

del

Here’s a minimal example:

using UnityEngine;
using System.Collections;

public class TriggerAndRun : MonoBehaviour {
    void OnTriggerEnter2D(Collider2D other)
    {
        // Get the Game Object
        GameObject go = other.gameObject;

        StartCoroutine("DoSomething", go);
    }

    IEnumerator DoSomething(GameObject go)
    {
        Debug.Log(go.name);

        yield return null;
    }
}
1 Like