So I have this script here
using UnityEngine;
using System.Collections;
public class CameraFallow : MonoBehaviour {
public Transform myTarget;
// Update is called once per frame
void FixedUpdate () {
if(myTarget != null)
{
Vector3 targPos = myTarget.position;
targPos.z = transform.position.z;
transform.position = targPos;
}
}
}
And I want it to target an object that has a certen tag, not just a defined object. How do I do that?