Calculating projectile speed by this method

I want to know how to calculate a projectile’s speed given that the projectile moved a body without any contact with it.

Given that :

  • The projectile weighs 70 kg

  • The body moved 8 meters and weighs 66 kg

  • The distance between the projectile ( arrow for example ) and the body is 5 cm

  • The distance from where the arrow was thrown at the body ( If that is needed ) is 12 meters

Is there a way to get an approximate result for the projectile’s speed under these conditions ?

Thank you in advance,
TryNewThings

If you want to push an object with the projectile in a ballistic trajectory to make it hit a target, my suggestion is to effectively launch the body in the target direction, and fake the projectile action: calculate the necessary velocity vector with the function BallisticVel below and assign it to the body’s rigidbody.velocity, then assign a slightly smaller velocity to the projectile, so that it would seem to have lost some energy pushing the body.

Supposing target is the target transform, and projectile and body are the
projectile and body transforms, you could do the following:

var target: Transform;
var projectile: Transform;
var body: Transform;

function BallisticVel(proj: Transform, targetPos: Vector3, angle: float): Vector3 {
    var dir = targetPos - proj.position;  // get target direction
    var h = dir.y;  // get height difference
    dir.y = 0;  // retain only the horizontal direction
    var dist = dir.magnitude ;  // get horizontal distance
    var a = angle * Mathf.Deg2Rad;  // convert angle to radians
    dir.y = dist * Mathf.Tan(a);  // set dir to the elevation angle
    dist += h / Mathf.Tan(a);  // correct for small height differences
    // calculate the velocity magnitude
    var vel = Mathf.Sqrt(dist * Physics.gravity.magnitude / Mathf.Sin(2 * a));
    return vel * dir.normalized;
}

// launch the projectile and "push" the body like this:
    // calculate the necessary velocity to launch at 30 degrees:
    var vel = BallisticVel(body, target.position, 30);
    // assign it to the body velocity:
    body.rigidbody.velocity = vel;
    // assign a slightly smaller velocity to the projectile:
    projectile.rigidbody.velocity = vel * 0.95; 
    ...