Ok Unity's Really Bugged Out This Time

Here’s my Console:


Here’s the Inspector:


And here’s the code:

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)

using Unityengine;

Should be:

using UnityEngine;
2 Likes

I hate case sensitive programming languages

You shouldn’t have to worry about case when a properly set up IDE should have auto-complete to fill out this for you.

If it isn’t, then you should look into fixing that.

2 Likes

Using UnityEngine is part of the base script template, so if you create the script inside Unity it should already have that at the top.

Yep, interesting how people manage to mess this up ^^.