playMaker

Author Topic: Damage strength = collision speed  (Read 1343 times)

masterr

  • Playmaker Newbie
  • *
  • Posts: 17
Damage strength = collision speed
« on: March 29, 2016, 01:51:38 AM »
Hi. I want to create a damage system. Imagine you have a spaceship and if you drive not
very carefully and you hit the walls i want the damage to be similar to the speed you hit the wall. Also the ship has 4 sides
and the damage will be taken from the 4 sides. Each side has for instance 100 health and when it gets damage
the color will change from green to red. For example in this picture right and bottom is good. Left has medium damage
and top has very little health left. And the player dies when any of sides reach 0 health. This is the basics what i want.
Now what i dont know is how to know which side of the ship has collided and at what speed do they collided :)
Is it the way to collide and activate a trigger at the same time? or i need to add another collider for the trigger event too?
Do i need 4 colliders for each side? I have some ideas for it but i dont know if they will work :) I will apply this ideas and post the results here. Thank for your time

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Damage strength = collision speed
« Reply #1 on: March 29, 2016, 01:58:25 AM »
Hi,

 yes, having a set of colliders will help organize your damage logic, at least it will be easier then if you had to build the logic behind it via code or complex fsm.

 Create empty gameobjects as child of your spacecraft and each will have its own collider and related fsm, they can then talk back to their parent to affect the health ( you have an action "get parent".

Bye,

 Jean