Day 14 of my Developer Journey: Destroying a parent objects
Jul 19, 2021
Our laser now functions as expected, but remains active after the lasers are destroyed, since they are part of a parent object. There is a simple fix to this.
We simply check if the our object has a parent object with a null check. If it does, we destroy everything. If not, we just destroy the laser.