Quantcast
Channel: Questions in topic: "random spawn"
Viewing all articles
Browse latest Browse all 125

i am working on a project . it is a quiz base 2D game . the problem is that i want to move one question to another randomly , but i don't know how ? This is a code which i trying but its not working please help me.

$
0
0
using UnityEngine; using System.Collections; using System.Collections.Generic; using Assets; public class NewBehaviourScript: MonoBehaviour { public List Questions; public bool AddToList; // Use this for initialization void Start() { Questions.Add(0); int q = Random.Range(1,3); Debug.Log (q); foreach (var a in Questions) { Debug.Log(a); if (a == q) { AddToList = false; } else { AddToList = true; } } if (AddToList == true) { Questions.Add(q); GameObject.Find("q"); } // Questions.Add (quesnum); } // Update is called once per frame void Update() { } public void LoadQuestion() { } }

Viewing all articles
Browse latest Browse all 125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>