Hello guys! When the player shoot an object “like a bird”, the following code get executed which kills the bird (or destroys it). I need to add a line to this code that delays the destruction of the bird, only if the player keeps shooting at it for 2 or 3 seconds continuously. In other words, I need to be able to count how long the target is being hit with the player.
Thank you all in advance.
function OnTriggerEnter(hit : Collider)
{
if((hit.gameObject.name).Contains("bird") )
{
Destroy(hit.gameObject);
}
}