Grappling Throw/ Ragdoll Throw Script. How do you throw up and out?

I’m trying to make make third person fight game. Where you can grapple and toss the enemy character.

So far here is my script and I want the character to throw the enemy rigidbody to a specific point every time I activate the script. I have been dabbling with variations of this script and This is what I have so far. So in full application, the main character will grab the enemies collar and throw him up and out. here is what I have so far :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static UnityEngine.GraphicsBuffer;

public class addforce : MonoBehaviour
{

    Rigidbody RB;
    float magnitude = 500;

    public Transform ThrowPt;

    public GameObject ragdoller;

    void Start()
    {

        if (Input.GetKeyDown(KeyCode.E))
        {
            RB = GetComponent<Rigidbody>();
          
            RB.AddForce(Vector3.forward * magnitude, ForceMode.Impulse);
           
            Debug.Log("Threw it");
            ragdoller.SetActive(true);
        }

        if (Input.GetKeyUp(KeyCode.E))
        {
            ragdoller.SetActive(false);
        }
    }


    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            RB = GetComponent<Rigidbody>();

            RB.AddForce(Vector3.forward * magnitude, ForceMode.Impulse);

            Debug.Log("Threw it");
            ragdoller.SetActive(true);
        }

        if (Input.GetKeyUp(KeyCode.E))
        {
            ragdoller.SetActive(false);
        }
    }
}

Using a tweener is probably the easiest way to go, such as LeanTween or DOTween.

Alternately you could define the throw curve with some kind of bezier spline.

1 Like

Maybe add an Explosive force? Unity - Scripting API: Rigidbody.AddExplosionForce

1 Like

cool thanks I will research that and try it.