OnCollisionEnter2D refer to game object which does not have the script code example Example: collision detector unity c# 2d void OnCollisionEnter2D(Collision2D coll){)