How do you calculate the Vector3 direction you want to use for AddForce on rigidbody?

I’m combining two different tutorials here in which I place the Lerpz prefab (along with his walking / attacking / camera motion) scripts into the Apartment scene where you can click and throw furniture around with your mouse.

I want Lerpz to be able to punch the furniture and have it move directly away from him along the x and z axes, and slightly up along the y axis. The collision detection is no problem, but I’m having a hard time finding information about how to caluculate the correct Vector3 to make the furniture fly away. It always seems to fly off to the side, rather than away from him.

519366--18435--$UnityWrongPhysics.jpg

Punching other items appears to send them in equally unpredictable directions as well. What am I doing wrong here, and what should I be doing instead?

// Modified version of ThirdPersonCharacterAttack.js from the 3D platformer tutorial
function DidPunch ()
{
	animation.CrossFadeQueued("punch", 0.1, QueueMode.PlayNow);
	yield WaitForSeconds(punchHitTime);
	
	var pos = transform.TransformPoint(punchPosition);
	
	var furnitures:GameObject[ ] = GameObject.FindGameObjectsWithTag("furniture");
	for(var go:GameObject in furnitures){
		if(Vector3.Distance(go.transform.position, pos) < punchRadius){
			print("I can punch " + go);

			// Reflect isn't giving me what I need, or so it appears...
			// What should I use instead?
			var v = Vector3.Reflect(pos, go.transform.position);

			// or is Reflect correct after all, but I'm just using the values in the wrong way?
			go.transform.rigidbody.AddForce(new Vector3(v.x * 100, 500, v.z * 100), ForceMode.Force);
		}
		
	}
	
	
	yield WaitForSeconds(punchTime - punchHitTime);
	busy = false;
}

I’m assuming you want the furniture to move in the opposite direction of lerpz forward vector, right? Instead of using punchPosition, and assuming this script is on the player object, I would do something like:

var myWorldForward : Vector3 = transform.TransformDirection(Vector3.forward); // convert my local forward to world space
go.transform.rigidbody.AddForce(new Vector3(myWorldForward.x * 100, 500, myWorldForward.z * 100), ForceMode.Force);

Thank you, that’s perfect! It works exactly as I want now!