How do I fake gravity when I disable unity's gravity?

I have gravity disabled for my rigidbody because my game its gravity direction can change and one player can be on a different gravity direction as another.
I have a object made out of meshes and I want it to fall apart when I instantiate this object and collapse in the gravity direction of my choice.

I am using the script below but somehow the effect is never the same as when the rigidbody uses unity its gravity.

Its slower and does not entirely break apart when I use my code.
Changing my gravity amount does not seem to have any effect and I tried using different force modes. So how do I fake the same gravity or how can i apply different gravity directions as unity only supports one gravity at a time?

#pragma strict


private var currentGravDirection 	:Vector3;	
private var gravityAmount 			:float		= 20;
private var	rRigidbody				:Rigidbody;
private var usephys					:boolean = false;

//--------------------------------------------------------------------------------------------------------------------------------
//   
//--------------------------------------------------------------------------------------------------------------------------------
function Awake() :void
{
	rRigidbody 		= rigidbody;
}



//--------------------------------------------------------------------------------------------------------------------------------
//   
//--------------------------------------------------------------------------------------------------------------------------------
function FixedUpdate () 
{
	if(usephys)
	{
		rRigidbody.AddForce(currentGravDirection * gravityAmount, ForceMode.Force);
	}
}



//--------------------------------------------------------------------------------------------------------------------------------
//   
//--------------------------------------------------------------------------------------------------------------------------------
function SetGravDirection (gravDir :Vector3) :void
{
	currentGravDirection = gravDir;
	usephys	= true;
}

1 Answer

1

Ugh SendGravDirection was not called properly , I needed to use Broadcastmessage instead of sendmessage.