Something very bizarre is happening, I tried commenting out code for an enemy class and they still move. Why is this happening?
Something else is probably happening, causing it to not compile. Check your error log carefully. Some errors may look like runtime errors but are actually from the compilation phase, and it lets you run the project anyway. I've been hit by that a couple of times this week.
Code would help. Errors/warnings would help. Is this when playing in the editor or in a standalone build? You haven't provided anything for anyone to even speculate on.
This is my code for grunt.cs and enemy.cs Code (csharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class Grunt : Enemy { static Player Active_Ply; static int World_LMask = 1 << 0; float Last_Shot; public GameObject Projectile_Obj; public Grunt() { Health = 30; Move_Speed = 2; Attack_Delay = 1; } Transform Head; Rigidbody2D RBody; // Aims only where the player currently is. No leading. // Use this for initialization void Start () { Head = transform.GetChild(0); RBody = GetComponent<Rigidbody2D>(); if ( Active_Ply == null ) { Active_Ply = GameObject.FindWithTag("Player").GetComponent<Player>(); } } void FixedUpdate() { if ( Time.timeScale == 0 ) { return; } if ( Active_Ply == null ) { Active_Ply = GameObject.FindWithTag("Player").GetComponent<Player>(); } RaycastHit2D Sight_Check = Physics2D.Linecast( transform.position, Active_Ply.transform.position, World_LMask ); if ( Sight_Check.collider != null ) { return; } transform.up = (transform.position - Active_Ply.transform.position).normalized; if ( Last_Attack + Attack_Delay <= Time.time ) { Last_Attack = Time.time; GameObject New_Bullet = Instantiate ( Projectile_Obj ); New_Bullet.transform.position = transform.position; New_Bullet.transform.up = -Head.transform.up; } if ( Vector3.Distance(transform.position, Active_Ply.transform.position) > 2 ) { //RBody.AddForce( -transform.up * 2 ); //RBody.velocity = new Vector2(-transform.up.x, -transform.up.y) * 2; Debug.Log(RBody.velocity); return; } } } Code (csharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class Enemy : MonoBehaviour { protected int Health ; protected float Move_Speed, Last_Attack, Attack_Delay; public float last_damaged; SpriteRenderer Sprite; public virtual void Stop_Flash() { GetComponent<SpriteRenderer>().color = Color.white; } public virtual void Damaged( int dmg_amt ) { Health -= dmg_amt; if ( Health == 0 ) { Destroy(gameObject); } GetComponent<SpriteRenderer>().color = Color.red; Invoke("Stop_Flash",.1f); } public Enemy() { } // Use this for initialization void Start () { gameObject.layer = 11; Sprite = GetComponent<SpriteRenderer>(); } // Update is called once per frame void Update () { } }