MCQs > IT & Programming > Unity3D > Output of the code assuming that myGameObject does not exist in the scene?

Unity3D MCQs

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); } }


Answer

Correct Answer:

NullReferenceException

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Unity3D Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Unity3D Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it