Can't instantiate prefab gameObject without destroy the Block

hi all,

i want to instantiate a Prefab gameObject without destroy my block, when i hit my block like you can see i have change the instantiate by SparkleHitsParticules of the block breaker Course, but when I change the instantiate by my prefab GameObject my block is destroying and release the instantiate prefab that i don’t want i have tag my blocks Unbreakable and i want that when i hit it my Unbreakable block release my prefab gameobject without destroying my Unbreakable Block how can i do please?

gs

Hi,

You could write a new class for the unbreakable blocks. Whenever they get hit by something, they instantiate a prefab. Use the OnCollisionExit2D method.

Dis this help?


See also:

I forgot to mention: If you want to optimise the performance, do not instantiate a new prefab each time the unbreakable block gets hit. Instead, create a child game object with a particle system attached. Reference that particle system in your class/component and call Play() on it whenever the block gets hit.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms