Questions in topic: "multiple-choice"http://answers.unity.com/questions/topics/single/4230.html
The latest questions for the topic "multiple-choice"Cycle through a number of itemshttp://answers.unity.com/questions/1626540/cycle-through-a-number-of-items.html
**Issue Context:**<br>
So, I need a little help around a simple functionality that I am finding hard to implement code-wise.<br>
<br>
Let's say I am putting my Unity skills to the test by recreating the logic of the very first video game I ever had: "*Disney's A Bug's Life*" for PS1 (nostalgia kicked in).<br>
If any of you played it back in the day, you might remember that Flik (the main character) can change the color of the seeds he comes across, and thus germinate different kinds plants.
However, he has to collect specific colored tokens in order to "unlock" new plants.<br>
<br>
**Pratical Example:**<br>
For those of you who don't know the game, let's put it this way:<br>
- At the beginning of each level, Flik can only germinate a mushroom (which corresponds to the default brown seed).<br>
- If Flik collects a green token, he can then move close to a seed and change its color from brown to green. That way he can germinate a one-leaf-plant.<br>
- If Flik collects a blue token, he can change the color of a seed by cycling between brown, green and blue.<br>
- Basically, Flik can cycle through the colors of the tokens he has collected, in order to assign that color to any seed.<br>
<br>
**The Issue:**<br>
I am having trouble recreating this logic because I'm not really sure what is the best way to properly set it.<br>
<br>
My idea is to do it in the GameManager script, so it can be accessed if Flik comes close to a seed and the player presses the button to change its color.<br>
<br>
Remember: at the beginning Flik only has the brown token (he can only germinate a mushroom). But how can I add a new color when Flik collects a green, a blue, a purple, a yellow token? Should I use an array? I am very confused about the logic at this point.arraysplatformeraddingcyclemultiple-choiceSat, 27 Apr 2019 23:05:36 GMTgabagpereiraI need a help about multiple questions poped uphttp://answers.unity.com/questions/1568228/i-need-a-help-about-multiple-questions-poped-up.html
Hi guys! I am very new to unity 3D, and i have no idea how to add multiple question to specific components.
I am setting up a structure in the sky, and i want to add multiple questions to the structure.
Now, i created empty component named as a structure, then added a structure which is in the sky as a child. I also added box collider to empty component right bottom of "a structure".
What i want to do is if the character goes near a structure, multiple question will be poped up, and if the character got wrong answer, the structure will be fall to the bottom, and the character standing under the structure will died. (I added the screenshot what i have worked)![alt text][1]
Please help me!
I know there are lots of clever people who can help me here.
I do not need whole works. I need a way how to do it!
I love you guys
Thank you so much
I hope that you guys have an amazing day!
[1]: /storage/temp/127105-untitled.pngscripting beginnerfallingaddingcharacter controllingmultiple-choiceFri, 02 Nov 2018 23:58:37 GMTPerryhanBest way for dialogue and choices?http://answers.unity.com/questions/1528456/best-way-for-dialogue-and-choices.html
Hello,
I'm newish to Unity and wanting to make a Visual Novel based game that has a dialogue system which has a choice system that also remembers certain choices as well as doing seperate dialogue for each choice.
However the way I have done it is not the best, I have the code I have below:
public string[] names;
public string[] sentences;
public Sprite[] characters;
public TextMeshProUGUI nameDisplay;
public TextMeshProUGUI dialogueDisplay;
public Image characterBox;
public GameObject continueButton;
public AudioSource audioSource;
public float typingSpeed;
private int index;
void Start()
{
audioSource.Play();
StartCoroutine(Type());
nameDisplay.text = names[index];
characterBox.sprite = characters[index];
}
void Update()
{
if(dialogueDisplay.text == sentences[index])
{
continueButton.SetActive(true);
audioSource.Stop();
}
if (Input.GetMouseButton(0))
{
typingSpeed = 0.005f;
} else
{
typingSpeed = 0.02f;
}
}
IEnumerator Type()
{
foreach(char letter in sentences[index].ToCharArray())
{
dialogueDisplay.text += letter;
yield return new WaitForSeconds(typingSpeed);
}
}
public void NextSentence()
{
audioSource.Play();
continueButton.SetActive(false);
if(index == sentences.Length - 1)
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
if(index < sentences.Length - 1)
{
index++;
dialogueDisplay.text = "";
nameDisplay.text = "";
nameDisplay.text = names[index];
characterBox.sprite = characters[index];
StartCoroutine(Type());
} else
{
dialogueDisplay.text = "";
nameDisplay.text = "";
nameDisplay.text = names[index];
characterBox.sprite = characters[index];
continueButton.SetActive(false);
}
}
How would I start on a system that would allow for choices that trigger and get remembered, as well as choices leading to different dialogue paths. What's the best route for this?dialoguemultiple-choiceThu, 12 Jul 2018 12:26:41 GMTMistyisty123C# MultipleChoicehttp://answers.unity.com/questions/1265616/c-multiplechoice.html
Ok, so I want a multiple choice question and answer that is triggered by the player talking to an NPC. I don't know anything about C# scripting and I'm doing a school game design assignment, it's due next Tuesday and I can't move forward until I get this fixed. Can anyone help me? Im not being assessed on the scripting, just the design. We have been given a package of assets and scripts to use. Can anyone help me. The resources I've researched all come up with errors in unity, and my teacher doesn't know that much about C# and I don't know anything. Can anyone help me?c#scripting problemheightmultiple-choiceWed, 02 Nov 2016 02:48:15 GMTIced_HamHandling Multiple U.I. Input Fieldshttp://answers.unity.com/questions/1149288/handling-multiple-ui-input-fields.html
I have a virtual keyboard I made that I'm using but I'm trying to figure out how to get it to work with multiple input fields?
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Keyboard4ConFig : MonoBehaviour {
//Input Field references
public InputField inputFieldPilotName;
public InputField inputField_LoadScreenTime;
public GameObject keyboardPanel04;
//public Text morseCodeDisplayText;
//animator reference
private Animator KB3Panim;
void Awake(){
inputFieldPilotName.text = PlayerPrefs.GetString("PilotName");
inputField_LoadScreenTime.text = PlayerPrefs.GetString ("IntroTime");
//morseCodeDisplayText = GameObject.Find ("MorseCodeDisplayText").GetComponent<Text> ();
//morseCodeDisplayText.text = PlayerPrefs.GetString("MorseMessage");
}
void Start ()
{
//Just in case we need the Keyboard retractable to make room for more configurations.
//get the animator component
//KB3Panim = keyboardPanel04.GetComponent<Animator>();
//disable it on start to stop it from playing the default animation
//KB3Panim.enabled = false;
inputFieldPilotName = GameObject.Find ("InputFieldPilotName").GetComponent<InputField> ();
inputField_LoadScreenTime = GameObject.Find ("InputFieldLoadScreenTimeDuration").GetComponent<InputField> ();
//inputFieldPilotName.Select();
//inputFieldPilotName.ActivateInputField();
}
/*
#region Panel Slide In Control
//Start Morse Code Keyboard Panel Slide In Animation
public void StartKB3PanelSlideIn(){
StartCoroutine (KB3PanelSlideIn ());
}
IEnumerator KB3PanelSlideIn(){
yield return new WaitForSeconds (0.6f); // wait time
KB3Panim.enabled = true;
SFXmanager SFXpi = FindObjectOfType<SFXmanager> ();
SFXpi.PanelSlideInSFX ();
KB3Panim.Play("MorseKeyboardSlideInAni");
}
//Start Morse Code Keyboard Panel Slide Out Animation
public void StartKB3PanelSlideOut(){
StartCoroutine (KB3PanelSlideOut ());
}
IEnumerator KB3PanelSlideOut(){
yield return new WaitForSeconds (0.6f); // wait time
KB3Panim.enabled = true;
SFXmanager SFXpi = FindObjectOfType<SFXmanager> ();
SFXpi.PanelSlideOutSFX ();
KB3Panim.Play("MorseKeyboardSlideOutAni");
yield return new WaitForSeconds (2.0f); // wait time
KB3Panim.enabled = false;
}
#endregion
*/
public void readButton (string c){
//Pilot Name
inputFieldPilotName.text += c;
//inputFieldPilotName.Select();
//inputFieldPilotName.ActivateInputField();
inputFieldPilotName.caretPosition = 0;
//Load Screen time Input
//inputField_LoadScreenTime.text +=c;
//inputField_LoadScreenTime.Select ();
}
public void deleteText(){
inputFieldPilotName.Select();
inputFieldPilotName.ActivateInputField();
inputFieldPilotName.text = "";
}
string messageToSend;
public void submitText(){
messageToSend = inputFieldPilotName.text;
//morseCodeDisplayText.text = inputFieldMC;
PlayerPrefs.SetString ("PilotName", inputFieldPilotName.text);
}
public void dell(){
inputFieldPilotName.Select();
inputFieldPilotName.ActivateInputField();
}
}c#uikeyboardinputfieldmultiple-choiceTue, 01 Mar 2016 20:30:38 GMTKnightRiderGuy[Multiple-Choice Quiz Game] How to change the text quiz answer in the button into image?http://answers.unity.com/questions/1102686/multiple-choice-quiz-game-how-to-change-the-text-q.html
I want to make a simple multiple choice quiz game with the coding below, but I want to make the multiple choice answers as image and the answer key too, so the right answer will be corrected with the same image, what should I change on the script ? Maybe any other opinion to make the multiple choice answers are image and the answer key (right answer). I'm new to Unity3D, and I'm sorry for my bad English.
private int idLevel;
public Text quest;
public Text answerA;
public Text answerB;
public Text answerC;
public Text answerD;
public Text infoAnswer;
public string[] dbQuest;
public string[] dbAnswerA;
public string[] dbAnswerB;
public string[] dbAnswerC;
public string[] dbAnswerD;
public string[] trueAnswer;
private int idQuest;
private float answer;
private float question;
private float media;
private int infoLevel;
void Start () {
idLevel = PlayerPrefs.GetInt ("idLevel");
idQuest = 0 ;
question = dbQuest.Length;
quest.text = dbQuest [idQuest];
answerA.text = dbAnswerA [idQuest];
answerB.text = dbAnswerB [idQuest];
answerC.text = dbAnswerC [idQuest];
answerD.text = dbAnswerD [idQuest];
infoAnswer.text = "question "+(idQuest + 1).ToString()+" from "+question.ToString()+"";
}
public void answ(string dbAnswer)
{
if(dbAnswer == "A"){
if(dbAnswerA[idQuest] == trueAnswer[idQuest]){
answer += 1;
}
}
else if(dbAnswer == "B"){
if(dbAnswerB[idQuest] == trueAnswer[idQuest]){
answer += 1;
}
}
else if(dbAnswer == "C"){
if(dbAnswerC[idQuest] == trueAnswer[idQuest]){
answer += 1;
}
}
else if(dbAnswer == "D"){
if(dbAnswerD[idQuest] == trueAnswer[idQuest]){
answer += 1;
}
}
nextQuestion();
}
void nextQuestion(){
idQuest += 1;
if (idQuest <= (question - 1)) {
quest.text = dbQuest [idQuest];
answerA.text = dbAnswerA [idQuest];
answerB.text = dbAnswerB [idQuest];
answerC.text = dbAnswerC [idQuest];
answerD.text = dbAnswerD [idQuest];
....imageimagesquizmultiple-choiceWed, 25 Nov 2015 11:54:36 GMThueemultiple choice questionshttp://answers.unity.com/questions/708811/multiple-choice-questions.html
hi,,,iam basically trying to make a multiple choice question quiz..
i have 4 button answer so that user can select the correct one's.
in additon to that im having 5th button to check the input given by the user .how can i achieve this?
*i want to keep track the last button which the user pressed and the 5th button checks whether its correct or wrong. how to achieve it? plz reply to this mail mubaraksharieff91@gmail.com thanks in advance.quizmultiple-choiceFri, 16 May 2014 07:56:34 GMTmubarak_1How to create a array of answers within a time limithttp://answers.unity.com/questions/700236/how-to-create-a-array-of-answers-within-a-time-lim.html
I want to create a array of answers that cycle right after the other when the hint is answered correctly and gain 20 points. I have GUI texture buttons for the choices and I am using javascript. So far, my code for for the first GUI text hint looks like this:
#pragma strict
var invisibleTimer
function Start ()
{
guiText.text = "Hint: ";
}
function Update ()
{
invisibleTimer += 1 * Time.deltaTime;
if (invisibleTimer > 6)
{
guiText.text = "Hint: \nCreated in 1973";
}
}
And the separate GUI texture button code is this:
#pragma strict
var audioConfirmation : AudioClip;
var hoverTex;
var normalTex;
function OnMouseEnter ()
{
guiTexture.texture = hoverTex;
}
function OnMouseExit ()
{
guiTexture.texture = normalTex;
}
function OnMouseDown ()
{
audio.clip = audioConfirmation;
audio.Play();arraysguitexturemultiple-choiceSun, 04 May 2014 01:28:30 GMTCSmitten88Getting started on multiple choices kind of gamehttp://answers.unity.com/questions/658065/getting-started-on-multiple-choices-kind-of-game.html
Hello Unity community,
I'm thinking about making a multiple choices kind of game. Since it would be my first project in Unity I want to keep things **simple but entertaining enough**.
I was thinking about a game with an initial menu, and the game part.
The game part would be something like **simple screens**; since I'm a beginner I don't want too much graphic or complex things (probably no 3D) but this is just because I don't have the knowledge/capability to create good graphics and 3D stuff.
In these simple screens text about the storyline will be shown, and (not always) the player will be given a few option on what to do. These options will affect the outcome of the story and so on. I'm sure you get the idea.
Apart from the text I don't want these screens to be **graphically** poor either; maybe adding a background that fits the scenario the player is playing/reading at the moment would be nice. Since I'm no graphic artist I would not add character's images (unless there is an easy way to do it...), just general places that may resemble the described scenario.
Last thing I would like to implement simple **quizzes and puzzles**. And I am also thinking of doing a simple kind of "inventory", where players can keep obtained items and maybe use them later on; this inventory thing would be easy, maybe 3 -4 items at time and maybe always displayed on screen (so that there is no need to have a separate menu just for that).
So this is the game I have in mind, more or less.
***My question is:*** what would I need to implement the things written above?
I have **general knowledge** of coding (mostly Java and C-like stuff), but I'm no pro at it. So I was wondering if implementing a thing like that would be hard for me or not. How do you handle save-games in Unity?
For the **graphic/display** part: is there a framework, plugin or tool that can help me develop the game I have in mind? Something I should know? Please suggest anything, I'm totally new and don't give for granted that I know popular stuff. Can I also easily find graphics such as general backgrounds to use free of cost in my game? Or any other resources (even paid)? If there is an easy way to create simple characters, make them appear in dialogues and such, let me know. Please point me in right directions.
Final question: if I would like to make simple **connection to the internet** (such as store saved files, or other little things), how can I do it? There are tools, plugins, etc. for this also? Please point out anything that can make my life easier :)
I know this is a bit of a wall of text, so I'll be grateful to anyone who will take time to read and to carefully help me out.
Thanks a lot people! :D:D
*PS: If someone wants to help me out personally, code with me, collaborate or just make a good friendship I will gladly accept it, please PM me or write down your contacts. I can also help you out in little and simple tasks for beginners if you already have an ongoing project.*beginnersimpletoolsmultiple-choiceFri, 07 Mar 2014 18:59:48 GMTTsukeyomiLinking button press with questionshttp://answers.unity.com/questions/632021/linking-button-press-with-questions.html
Hey guys, Im making a board game which involves multiple choice questions to move forward. this is the script which displays the questions:
var arrayOfQuestions : Question [];
class Question
{
var questionText : String;
var answerText1 : String;
var answerText2 : String;
var answerText3 : String;
var answerText4 : String;
var correctAnswer : String;
/* example constructor (creates a Question from two params) */
function Question ( q : String, a : String, b : String, c : String, d : String, correct : String )
{
questionText = q;
answerText1 = a;
answerText2 =b;
answerText3 =c;
answerText4=d;
correctAnswer = correct;
}
}
/* initialize the question array in the start function */
function Start ()
{
arrayOfQuestions = new Question [2];
/* use a for loop to create dummy questions */
arrayOfQuestions[0] = new Question("Where are we?", "E6", "K8", "G1", "MoCap", "K8");
arrayOfQuestions[1] = new Question("Where are we?", "E6", "K8", "G1", "MoCap", "K8");
}
/* test it */
function OnGUI ()
{
var labelRect : Rect = Rect(200, 200, 300, 30);
for ( var thisQ : Question in arrayOfQuestions ) {
var txt = "Q: " + thisQ.questionText + " A: " + thisQ.answerText1 + " B: " + thisQ.answerText2 + " C: " + thisQ.answerText3 + " D:" + thisQ.answerText4;
GUI.Label(labelRect, txt);
labelRect.y += labelRect.height;
}
}
i was just wondering how do i link a button press to it?javascriptguibuttonmultiple-choiceTue, 04 Feb 2014 18:13:37 GMTMint92Hey, i need help with GUI text ibn javascripthttp://answers.unity.com/questions/260798/hey-i-need-help-with-gui-text-ibn-javascript.html
hey, Im making a code for a multiple choise question but for some reason when i drag the mouse over it , it does change coler but when i click, it does not, what could be going on?
#pragma strict
var correct = true;
var answer = true;
var wrong = false;
var locking = false;
function Start () {
Screen.lockCursor = true;
}
function Update () {
Screen.showCursor = false;
// center mouse
if (Input.GetKeyDown(KeyCode.P))
if (Screen.lockCursor)
Screen.lockCursor = false;
else{
Screen.lockCursor = true;
}
//if correct
if (Input.GetButtonDown("fire1")&& answer)
{
renderer.material.color = Color.green;
locking = true;
}
if (Input.GetButtonDown("fire1")&& wrong)
{
renderer.material.color = Color.red;
locking = true;
}
if (wrong && answer)
{
answer = false;
}
}
// change color when mouse is on
function OnMouseEnter ()
{
if (locking = false)
renderer.material.color = Color.red;
}
function OnMouseExit ()
{
if loking = false;
renderer.material.color = Color.white;
}
thanks a lotguitextmouserenderermultiple-choiceFri, 01 Jun 2012 01:21:25 GMTthenachotech1113multiple choice question in Unityhttp://answers.unity.com/questions/33981/multiple-choice-question-in-unity.html
<p>Hi I'm new to Unity, and have very limite programming skills. I want to make a question window, in the window it will have one question, the question will have four different answers. If the use select the wrong answer, "Try angain" will appear; if the use select the right answer, "Well done" will appear, and a close button will show up.</p>
<p>Can anyone give me some ideas? Thanks very much</p>
<p>===========================================</p>
<p>EDIT: Hi Bravini thank you very much</p>
<p>Sorry,I only can understand very simple code, so I tried to modified your code, but the last part not working, could you point out what's wrong?
Thanks very much</p>
<pre><code>var textToShow1: String;
var textToShow2: String;
var textToShow3: String;
var textToShow4: String;
function OnGUI () {
GUI.Label (Rect (20, 10, 500, 30), "-------------Q1?-------------------");
GUI.Label (Rect (120, 40, 500, 30), textToShow1);
GUI.Label (Rect (120, 70, 500, 30), textToShow2);
GUI.Label (Rect (120, 100, 500, 30), textToShow3);
GUI.Label (Rect (120, 130, 500, 30), textToShow4);
if(GUI.Button(Rect(20,40,80,20),"A1")) {
textToShow1="Try Again";
}
if(GUI.Button(Rect(20,70,80,20),"A2")) {
textToShow2="Try Again";
}
if(GUI.Button(Rect(20,100,80,20),"A3")) {
textToShow3="Try Again";
}
if (GUI.Button(Rect(20,130,80,20),"A4")){
textToShow4 ="Well done!";
if(GUI.Button(Rect(20,160,80,20),"close")){
Application.LoadLevel (1);
}
}
}
</code></pre>
<p>=======================================================</p>
<p>EDIT: I've fixed the problem. Thanks! At least I've learned something =)</p>
<pre><code>var isQuestionaryOn = false;
function OnGUI(){
if (GUI.Button(Rect(20,130,80,20),"A4")){
isQuestionaryOn=true;
textToShow4 ="Well done!";
}
if (isQuestionaryOn){
if(GUI.Button(Rect(20,160,80,20),"Back")){
Application.LoadLevel(1);
}
}
</code></pre>
<p>} </p>buttonpopupmultiple-choiceSun, 14 Nov 2010 21:40:09 GMTLucy