I wrote a script to create a layer with a particular name if it doesn’t already exist. This works, unless the layer was previously created and then deleted. Then, my code that checks to see if that layer already exists actually returns a layer that isn’t in the sprite’s list of layers (having been deleted). Obviously the check passes so I don’t create a new layer and then when I use the returned layer the script errors.
Any way to flush out deleted layers?