rigidbody in a twister need script for Force

hi i have a twister and i need all my rigidbodys that collied with it to move in to it and rotat up around it and when my rigidbody exit the the collieder thay fall back down can someone do a script like that
some thing like this one but the force is only applied when the rigidbody is in the collieder

function FixedUpdate () {
rigidbody.AddForce (Vector3.up * 10);
}

i would like it to rotat around the twister but if it gest gos up and out on the collision with my twister that works

if some one can do this i’m willing to pay them

some one???

Ooh money always gets people working :slight_smile:

Something like this?

This goes on the twister (With a collider that has isTrigger set to true).

function OnTriggerEnter(collider : Collider) {
	if(collider.gameObject.tag == "Player") {
		var script : InteractTwister = collider.GetComponent(InteractTwister);
		if(!script)
			Debug.Log("Could not find script: InteractTwister");
		else
		{
			script.inTwister = true;
			script.twister = transform;
		}
	}
}

function OnTriggerExit(collider : Collider) {
	if(collider.gameObject.tag == "Player") {
		var script : InteractTwister = collider.GetComponent(InteractTwister);
		if(!script)
			Debug.Log("Could not find script: InteractTwister");
		else
		{
			script.inTwister = false;
			script.twister = transform;
		}
	}
}

This goes on the object to be affected.

var twister : Transform;
var inTwister : boolean = false;
var rotateSpeed : float = 10;
var addForceSpeed : float = 15;

function FixedUpdate() {
    if(inTwister) {
        rigidbody.AddForce(Vector3.up*addForceSpeed);
	transform.RotateAround(twister.position, Vector3.up, rotateSpeed);
    }
}

EDIT: The second script would have to be called InteractTwister unless you change the code.

thank you thank you :smile: