Pick Up object, than spawn it again

Hi, I need to make so I can pick up object(oil flask) and it will spawn again on the same spot in 60 seconds for example.

I achieved this:

var up = transform.TransformDirection(Vector3.forward);
   	var hit : RaycastHit;    
   	Debug.DrawRay(transform.position, up * 10, Color.green);
 
   	if(Physics.Raycast(transform.position, up, hit, 10)){
      Debug.Log("Hit");    
      if(hit.collider.gameObject.name == "Oil"){
           
           if(Input.GetButtonDown("E"))
			{
				
				
				Debug.Log("hit");
			}
      }

So after I press E button object should dissapear and oil should spawn again in 60 seconds.

I can make oil dissapear thats no problem, but as you know, If I destroy that oil by destroy command, spawn script wont work. If I put oil and Oil spawn empty object on the same spot raycast will catch only the first object, not the other one so it will send information only to one object.

btw i will have many oils in map so I cant just set variable in that script to count to spawn that oil. because it would spawn oil everywhere where is oil spawn.

Ok, never mind I resolved this. If I knew How can i mark this as answered ( sorry but I have watched for 10 minutes for that button never found one ) I would mark it as answered. Dont know why Unity forum has to hide it.

Don’t destroy it! :slight_smile:

Just turn off it’s renderer and collider. Then, after a set time turn them back on!