Trigger a function only when a certain event happens

I am trying to develop a unity pun2 multiplayer, and I have a problem with applying damage when a projectile explodes in range of the player. So my question is… All network stuff apart.

How can I trigger a function inside my player GameObject when the explode function inside my throwable projectile GameObject is triggered? These are separate gameobjects.

You could Spherecast and check for any players within it and call the method on the ones that are.

I already thought of that. But I set a timer for the throwable projectile for explosion. I only want this script to be called when the explosion happens after the fixed time. That’s what confuses me.

If you already have the timer then just do as the above post mentioned once the timer has elapsed.