How can I use the randomize menu script?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
misaki_e
Posts: 20
Joined: Fri Apr 16, 2021 1:57 am

How can I use the randomize menu script?

Post 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.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: How can I use the randomize menu script?

Post by Tony Li »

Hi,

There was a typo in that post. I fixed it. Where is said 'array', it should be 'responses'.
misaki_e
Posts: 20
Joined: Fri Apr 16, 2021 1:57 am

Re: How can I use the randomize menu script?

Post by misaki_e »

Thank you so much, Tony! It's working now.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: How can I use the randomize menu script?

Post by Tony Li »

Great! Happy to help.
Post Reply