Hello Community I am working on a 2d platformer and following a tutorial by James Doyle (YouTube star: gamesplusjames). Particularly I am watching video 23 titled "How to Make Your Enemies Fire Projectiles" and having a problem understanding how the logic is supposed to work out.Lines 28-36 are where I need advice .If you need me to post more screenshots or code snippets just let me know and I will ASAP Original Video found here: Me trying to type out the logic.... If the Enemy localScale is -1 && the players transform.X is GREATER then the enemy's transform.X && playerTransformPosition GREATER then the enemy transformX + player range. Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class ShootAtPlayerInRange : MonoBehaviour { public float playerRange; public GameObject enemyProjectile; private PlayerController thePlayer; public Transform projectilePoint; public float waitBetweenShots; private float shotCounter; // Use this for initialization void Start () { thePlayer = FindObjectOfType<PlayerController>(); shotCounter = waitBetweenShots; } // Update is called once per frame void Update () { Debug.DrawLine(new Vector3(transform.position.x - playerRange, transform.position.y, transform.position.z), new Vector3(transform.position.x + playerRange, transform.position.y, transform.position.z)); shotCounter -= Time.deltaTime; /[B]//movingleft left Shoots left if (transform.localScale.x < 0 && thePlayer.transform.position.x > transform.position.x && thePlayer.transform.position.x < transform.position.x + playerRange && shotCounter > 0) {[/B] Instantiate(enemyProjectile, projectilePoint.position, projectilePoint.rotation); shotCounter = waitBetweenShots; } [B] if (transform.localScale.x > 0 && thePlayer.transform.position.x < transform.position.x && thePlayer.transform.position.x > transform.position.x - playerRange && shotCounter < 0) {[/B] Instantiate(enemyProjectile, projectilePoint.position, projectilePoint.rotation); shotCounter = waitBetweenShots; } } } And the enemyFireballController script.......... Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyFireballController : MonoBehaviour { public float speed; public float rotationSpeed; private PlayerController player; private LevelManager theLevelManager; public GameObject impactEffect; public int damageToGive; // Use this for initialization void Start() { player = FindObjectOfType<PlayerController>(); theLevelManager = FindObjectOfType<LevelManager>(); if (player.transform.position.x < transform.position.x) { speed = -speed; rotationSpeed = -rotationSpeed; } } // Update is called once per frame void Update() { GetComponent<Rigidbody2D>().velocity = new Vector2(speed, GetComponent<Rigidbody2D>().velocity.y); GetComponent<Rigidbody2D>().angularVelocity = rotationSpeed; } private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { theLevelManager.HurtPlayer(damageToGive); } Instantiate(impactEffect, transform.position, transform.rotation); Destroy(gameObject); } }