I have an enemy that rushes towards the player inside a small room (game is 2d). The enemy is a cube and has a child cube that acts as it’s collider for me. When the enemy runs past or through the player and goes towards a wall it just clips through the wall but when the enemy stops in the room and the player moves towards him the collider works and the player can’t clip through it.
I was wondering if there was an alternate to transform.Translate that would work in my position.
if(Move)
{
transform.Translate(Vector3.forward * speed * Time.deltaTime);
}