Im trying to code an ai enemy, but cant figure out how to include collision. I tried setting Character collision detection 2d as a boolean, but that raised a lot of error messages. Any ideas? Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class Alien1 : MonoBehaviour { public Vector2 moving = new Vector2(); // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { public bool collisionDetection = CollisionDetectionMode2D moving.x = moving.y = 0; if (collisionDetection = false) { moving.x = 1; } else if (collisionDetection = true) { moving.x = -1; } } }