I am developing a 2D game, I need to increase force applied by effectors (knockback) according to damage received by the objects (similar to super smash bros. series). For example:
I apply a force with a magnitude of 100:
object#1 received 0 damage, applied force = 100 (the same)
object#2 received 40 damage, applied force = 160 (increased)
object#3 received 90 damage, applied force = 230 (increased even more)
an image the clarifies the idea (from smash bros):
the ideas I came up with:
1- decrease the rigidbody’s mass as the received damage increases. The problem of this idea is that normal collisions will be affected as well, I need effectors only to have more knockback.
2- call addForce() manually, great flexibility, but needs more calculations and work to be done.
I am very intersted in the way super smash is developed. If someone has an idea to achieve similar behavior, then please let me know.
Thanks.