Help ! My script is not working and I can't find why !

Do someone can find what’s wrong with this script ? Normally It should pause the game and make text appears by clicking E. I made a first one EXACTLY like this one and it works perfectly. I copy/paste it, I change the ConversationA01 to ConversationA02 and now it doesn’t work

The script :

using UnityEngine;
using System.Collections;

public class Dialogue3 : MonoBehaviour
{

public GameObject[ ] ConversationA02;
public GameObject frame;
private int x;
public float convoLength;
private bool convoCheck = false;
private Fading fading;

void Awake ()
{
x = 0;
frame.SetActive (false);
foreach (GameObject text in ConversationA02)
{
text.SetActive(false);
}
}

void OnTriggerEnter2D (Collider2D other)
{
if (other.tag == “Player”)
{
x = 0;
frame.SetActive (true);
ConversationA02[×].SetActive(true);
Time.timeScale = 0;
convoCheck = true;
}
}

void FixedUpdate ()
{
if (Input.GetKeyDown (“e”) && convoCheck)
{

frame.SetActive (true);
ConversationA02[×].SetActive(false);
++x;

if (x > convoLength)
{
frame.SetActive (false);
convoCheck = false;
Time.timeScale = 1;
fading = GetComponent();
fading.StartCoroutine(“Fade”);
}
else
ConversationA02[×].SetActive(true);
}
}
}

So it launches when OnTriggerEnter2D is fired, the frame and the text appear everything is cool. Then I press E and the frame disappear and Time.timeScale is set to 1. So the stuff before the if is totally ignored. THEN it continue correctly, without the frame. It’s like it ignore some part and use other randomly … I tried to correct it but there’s nothing to do !

if you want to test it yourself you have to make an object tagged Player enter an Trigger2D, and you have to make a Canvas with one UI image named Frame and 3 UI text

Set everything and see

Thanks for reading

Please use code tags to make your code easier to read.

why are you using FixedUpdate when your code does nothing physics based?

Because I’ve read That Time.timeScale doesn’t work under Update() functions.

I’m trying desperately to make a dialogue systeme but I don’t know how

I

erm… no.

wrong way around