Question by
shadowpuppet · Jan 05, 2017 at 03:17 AM ·
instantiate prefabdestroy-clones
destroy prefab over time
I know, there are posts similar but not working. I get an error "destroying assets is not permitted to prevent data loss" what I have is a gun that spits out spent shell casings after every shot. The spent casing is a prefab that instantiates. I really only care about seeing the casing as it first flies from the gun. After that I would rather it disappear. Maybe no big deal but my stage window ( hierarchy window far left) gets bombarded with clones of the instantiated spent casing prefab. this is all the code that matters below
Instantiate(casing, clipEject.position, clipEject.rotation);
Destroy(casing, .2f);
Comment