Hi guys, I’m trying to follow up on a C# Unity textbook I’m reading. It said that if I use this script on the main camera
using UnityEngine;
using System.Collections;
public class ReturnZombie : MonoBehaviour
{
//Use this for initialization
void Start ()
{
}
//Update is called once per frame
void Update ()
{
Debug.DrawLine(transform.position,
GetZombie().transform.position);
}
//returns a zombie
Zombie GetZombie()
{
return (Zombie)GameObject.FindObjectOfType(typeof(Zombie));
}
}
And created a gameobject with a zombie class attached to it, I’d see a line drawn between the object and the camera in scene view. Well, I don’t see it. ![]()
This is the screenshot the textbook attached that I’m supposed to see:
What am I doing wrong?