- Home /
GameObject cant find definition for anything, 2 suggesteds,GameObject only has Equals and Reference Equals
GameObject's only suggesteds are Equals and Reference Equals, everything else it cant find a definition for using System.Collections;
using UnityEngine;
public class CameraMotor : MonoBehaviour {
private Transform lookAt;
void Start () {
GameObject.FindGameObjectWithTag ("Player");
}
void Update () {
}
}
,using System.Collections;
using UnityEngine;
I just want my camera to follow the player but GameObject's suggesteds only return Equals and Reference Equals and cant find a definition for anything else I try.
public class CameraMotor : MonoBehaviour {
private Transform lookAt;
void Start () {
GameObject.FindGameObjectWithTag("Player")
}
void Update () {
}
}
also the solution isnt lookat = gameobject etc. Ive already did that
Answer by hectorux · Jun 28, 2018 at 10:42 PM
Of course, you have to make a variable where you store the object, make a variable GameObject and equal it to the find. GameObject objIWantToLook; void Start(){ objIWantToLook=GameObject.FindGameObjectWithTag("Player"); }