Page 1 of 1

How can I use the randomize menu script?

Posted: Tue Apr 20, 2021 10:43 pm
by misaki_e
Hello,

I want to be menu showing randomize order, then I found the following post:
https://pixelcrushers.com/phpbb/viewtop ... 271#p12271

However, I couldn't use the script because it occurs an error.
I'm a completely beginner and I'm not a programer, so I guess I just make elementary mistake, but I want you to help.

I did the following steps:

==============================

1. Select “Dialogue Manager” in Hierarchy and select “Add Component” in Inspector.

2. Enter “ShuffleResponses” in searching form and select “New Script” and create and add it.

3. Paste the code into the ShuffleResponses script from the post, and saved.

4. An error occurs like following in Unity:

Assets/ShuffleResponses.cs(17,17): error CS0103: The name 'array' does not exist in the current context

==============================

I also searched the error text, then I found this:
https://stackoverflow.com/questions/498 ... nt-context

However, I didn't delete

Code: Select all

using System.Collections;
using System.Collections.Generic;
so I couldn't understand what I should fix.

Could you tell me the solution?

Thank you in advance.

Re: How can I use the randomize menu script?

Posted: Wed Apr 21, 2021 10:44 am
by Tony Li
Hi,

There was a typo in that post. I fixed it. Where is said 'array', it should be 'responses'.

Re: How can I use the randomize menu script?

Posted: Wed Apr 21, 2021 8:53 pm
by misaki_e
Thank you so much, Tony! It's working now.

Re: How can I use the randomize menu script?

Posted: Wed Apr 21, 2021 9:19 pm
by Tony Li
Great! Happy to help.