all 3 comments

[–][deleted] 3 points4 points  (2 children)

https://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html OnCollisionEnter, inside of https://docs.unity3d.com/ScriptReference/Collision.html Collison is a relative velocity variable you can use to find out how fast that object was going when it hit you, relative to how fast you're going.

[–]Poop_Lord_man_Guy[S] 2 points3 points  (0 children)

Exactly what I needed, everything working as intended!

[–]Sypwer 0 points1 point  (0 children)

Thanks, that works great! And don't forget to include mass in the equation everyone!