Torch Properties (push and destroy on timer)

I’m trying to make it when the torch is picked up by the player a timer starts and once the timer ends it will destroy the torch in hand and while holding the torch it pushes the enemy away, but not sure how to go about doing that

3269688--252533--item pickup.PNG

Destroying the torch after time is easy: use a coroutine:

void StartTorch()
{
StartCoroutine(TorchLife(15)); // light torch for 15 seconds
}

IEnumerator TorchLife(float numSecondsToStayLit)
{
yield return new WaitForSeconds(numSecondsToStayLit);
Destroy(torchObject);
}

For the enemy pushback, I’d probably go with a trigger collider on the torch, then if an enemy detects it, make the enemy change direction (or whatever evasive action they require). Think of it as an enemy behaviour (avoiding the torch) rather than a torch behaviour.