I’m trying to make a shooter game, and i’m trying to edit the code for the bullet impact effect to make it disappear. but it comes up with this error.
error CS0266: Cannot implicitly convert type UnityEngine.Object
to UnityEngine.GameObject
. An explicit conversion exists (are you missing a cast?)
GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal));
Destroy (impactGO, 2f);
using UnityEngine;