- Home /
Convert type `UnityEngine.Collider' to `string'?
How can I do what this script does but without getting this error?
Error:
Assets/FPS/Scripts/Managers/Enemy.cs(13,46): error CS1503: Argument `#1' cannot convert `UnityEngine.Collider' expression to type `UnityEngine.Transform'
Code:
void OnTriggerStay(Collider other) {
if (other.tag == "Player"){transform.LookAt(other);}
}
Comment
Best Answer
Answer by clunk47 · Oct 30, 2013 at 05:57 PM
if(other.tag == "Player")
transform.LookAt(other.transform);