i have a falling gameobject"main guy" and an empty game object with ontriggerEnter to detect an objects velocity before it hits the ground.
and i have this script to apply damage when falling to fast.

function OnTriggerEnter2D(coll: Collider2D){
	var mainguy = GameObject.Find("main guy");
	var myVelocity = mainguy.gameObject.rigidbody2D.velocity.y;
	if(coll.gameObject.name =="main guy"){
		if(myVelocity > 2){
		GameObject.Find("main guy").SendMessage("ApplyDamage");
		}
	Debug.Log(myVelocity);
	}
}

i have a feeling that when i put “if(myVelocity > 2)” it looks at the starting velocity of the object the the velocity when it detects the ontriggerenter. i need it to have the velocity when detected by the OnTriggerEnter. can anyone help??

Well, he is falling, so velocity is most likely negative something, so if you’re saying if the velocity.y is more than 2, this would only be true if the object is moving upwards. What you want is less than -2 as an example.

if(myVelocity < -2)

The bigger the negative number, the faster the object is falling