You will need to declare var *remainingTime* outside of Update() in order to access it from another script.
You can keep it private and create a getter/setter, then set its new value after the player falls; Or, use a function created inside the TimeController class and call it:
public void function SubtractFromTimer(float time)
{
remainingTime -= time;
}
As @OG23 mentioned, you can place a collider/trigger underneath the platform and when the player enters said collider, respawn the player and subtract from the remaining time.
Hope this helps!
↧