Here’s my Console:
using System.Collections;
using System.Collections.Generic;
using Unityengine;
public class camfollow : MonoBehaviour
{
public Transform target;
public Vector2 dist;
public float smooth;
public Object capule;
private string stringtosearch;
private float dir;
private float todir;
private Quaternion lastangle;
private Transform targettransform;
void Start()
{
}
void Update()
{
if (target.transform.position.x < 99888)
{
targettransform = target.transform;
transform.position = target.transform.position; //goes to target
}
else
{
transform.position = targettransform.position;
}
transform.position += new Vector3(0 - Mathf.Cos(dir * Mathf.Deg2Rad) * dist.x, dist.y, 0 - Mathf.Sin(dir * Mathf.Deg2Rad) * dist.x); //offsets the z and y position by dist
if (Input.GetKeyDown("a"))
{
todir += 90;
}
if (Input.GetKeyDown("d"))
{
todir += -90;
}
dir += (todir - dir)/smooth;
lastangle = transform.rotation;
transform.LookAt(target, Vector3.up); //looks at target
transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, transform.eulerAngles.z); //resets x rotation
}
}
What has happened to Unity?! (It’s not the meta data)