Making enemies push player back.

Hi all,
I am a beginner in unity programming, and I’m currently making a parkour game. I want to make the enemies move towards player, and push him back. I have a c# script, which makes the enemies rotate to see the me, then move to me. It looks like this:
using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour {
    Transform target; //the enemy's target
    float moveSpeed = 3f; //move speed
    float rotationSpeed = 3f; //speed of turning
     
    Transform myTransform; //current transform data of this enemy
     
    void Awake()
    {
    myTransform = transform; //cache transform data for easy access/preformance
    }
     
    void Start()
    {
    target = GameObject.FindWithTag("Player").transform; //target the player
     
    }
     
    void Update () {
    //rotate to look at the player
    myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
    Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
     
    //move towards the player
    myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
     
     
    }
}

I got it from another thread on this forum, but the enemies just approach me and the rotate around me. So, I want to make them push me back. Is there a way to do this (I use the standard 1st person controller and the enemies are cubes, with box colliders.
Also, I’d prefer c#, because i started programming with this language.

Do your enemies have rigidbodys? Cuz if they have, just make sure they don’t stop walking forward when they reach the player and they push it autamatically…At least this happens in my game :smiley: