text and image prefab not popping up when set.active

Hi guys. I made a script so when a player hit an object a ui window pops up, the scene freezes for 3.5 seconds and then it resumes. Although I managed to run the co routine successfully when the player hits the trigger no UI elements (neither the image nor the text) are popping up. I ve made a prefab for both of them. Any idea why this is happening?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GUIwin : MonoBehaviour {

	public GameObject textprefab;
	public GameObject imageprefab;

	IEnumerator OnTriggerEnter(Collider other)
		if (other.CompareTag ("Player")) {


			Time.timeScale = 0.0f;

			yield return new WaitForSecondsRealtime(3.5f);


			Time.timeScale = 1.0f;

You need to use instances of these prefabs in the scene. You can create these instances in the editor itself or at runtime. Then assign these instances to their respective variables for text and image.

Try setting time to 0.001f instead of 0.0f