using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpikeDestruction : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter2D (Collision2D collision)
{
if (collision)
{
Destroy(gameObject);
}
}
}
Ive followed some tutorials and they work but mine doesn’t i just want if it hits something it gets destroyed but theres always the error Assets\Scripts\SpikeDestruction.cs(22,13): error CS0029: but i don know how to fix it
Any suggestions