i just created a script that looks like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
void Start()
{
Collider2D[] colliders = transform.GetComponentInChildren<Collider2D>(); //error here
}
// Update is called once per frame
void Update()
{
}a
}
the error i got was exactly like this: Assets\PlayerController.cs(17,34): error CS0029: Cannot implicitly convert type ‘UnityEngine.Collider2D’ to ‘UnityEngine.Collider2D[ ]’
does anyone know how to fix this?