You know how in Minecraft it takes lets say 0.5 seconds to delete a grass block, but it takes 3.5 to delete a stone block. I would like to know how to make something like that. I use C#.
1 Answer
1Destroy has a timer parameter:
public GameObject grass:
public GameObject block;
Destroy(block, 3.5f);
Destroy(grass, 0.5f);
Is this C#? I have my blocks as prefabs how would I go about that?
– Ghosts_Riley@Ghosts_Riley yes it is c# code. You can drag and drop your prefab to particular game object from unity Editor.
– Santosh_PatilIf from the moment you are creating your prefab, you want it to live for some time only, you can add a script to the prefab with this: void Start(){ Destroy(gameObject,3.5f); }
– fafase