Recoil, addforce to one object in the direction from a different object

public class GunShoot : MonoBehaviour
{
public Rigidbody Bullet;
public Transform BulletSpawn;
public int damage = 10;
public float bulletVelocity = 500f;

    public ParticleSystem mf;

    public PlayerMovement playerMovement;
    public Rigidbody Tank;
    public Transform Gun;
    public float recoil = -600f;


    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown("left ctrl"))
        {
            mf.Play();
            Shoot();
        }

    }
    void Shoot()
    {
        Rigidbody bulletInstance;
        bulletInstance = Instantiate(Bullet, BulletSpawn.position, BulletSpawn.rotation) as Rigidbody;
        bulletInstance.AddForce(BulletSpawn.forward * bulletVelocity);
        
        Recoil();
    }
    public void Recoil()
    {
        Tank = GetComponent<Rigidbody>();
        Tank.AddForce(Gun.transform.forward * recoil);

    }
}

So here is what im trying to do, its a tank, the turret can rotate independently of the body id like to add a recoil to the body but in the opposite direction of the turret. so im not sure how to add force to the tank but use the transform direction from the gun

any ideas?

@Lordricker I think I have a solution to your problem. You can attach a “force” component to your GameObject then use public Force force; and force.SetActive; to enable and disable the force. Hope this helps you in your gamedev journey!

Have fun,
Aaron

use the force