Learn and practice your skills with our MCQ question answers to improve your knowledge. MCQs list
Start Practice with MCQsQuizack 10 minutes test will assess your knowledge and give you comprehensive results along feedback.
Start QuizDownload Free Unity3D MCQ questions answers PDF to practice and learn while are offline.
Download PDF
Used by 100s of Jobseekers and students
Focused questions for skill assessment
Premium questions with correct answers
Which of the following will call MyUpdateMethod() every 1 second?
void Start(){ StartCoroutine(CallMyMethod()); gameObject.SetActive(false); } IEnumerator CallMyMethod(){ while(true){ yield return new WaitForSeconds(1); MyUpdateMethod(); } }
void Start(){ Invoke("MyUpdateMethod",1); gameObject.SetActive(false); }
void Start(){ InvokeRepeating("MyUpdateMethod",1,1); gameObject.SetActive(false); }
float lastUpdateTime=0.0f; void Start(){ gameObject.SetActive(false); } void Update(){ if(Time.time-lastUpdateTime>1){ lastUpdateTime=Time.time; MyUpdateMethod(); } }
Answer:
void Start(){ InvokeRepeating("MyUpdateMethod",1,1); gameObject.SetActive(false); }
What is the output of the following code assuming that myGameObject does not exist in the scene?
using UnityEngine;
using System.Collections; public class Example : MonoBehaviour { void Start () { GameObject go = GameObject.Find("myGameObject"); Debug.Log(go.name); } }
NullPointerException
NullReferenceException
null
myGameObject
Answer:
NullReferenceException