playMaker

Author Topic: Way to record physics interactions for damage?  (Read 380 times)

daniellogin

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Way to record physics interactions for damage?
« on: September 07, 2019, 01:34:21 AM »
I'm wanting to know if anyone knows a way to get data from physics interactions, for the purpose of using numbers for damage and etc.

Like somewhere in unity, when object A hits object B, it figures out how much force to apply based on the speed of impact and what not. I want to use the same number which would apply the force, but instead use it so it registers as damage.

An example would be the Roblox game 'broken bones', where the player intentionally throws them self off a cliff in the hope of breaking as many bones as possible (to get score).

Another example may be Turbo Dismount, where the player rides silly vehicles in the path of other ones, to again get as much damage as possible.

To break it down another way, I would like it so if the player jumps from a height, when their foot collider hits the ground then it takes a reading of how bad the impact was. Not just that it impacted, or when you walk it would be like 'oh I'm dieing', etc.

Another example is if you have a stationary fan, if you slowly move in to it then it won't do damage, but when it spins fast then it will deliver more physics force and so more damage.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5932
    • View Profile
    • jinxtergames
Re: Way to record physics interactions for damage?
« Reply #1 on: September 07, 2019, 09:10:30 AM »
Hi.
The 'collision event' stores 'Force'
This should store the impact force i believe.