- Home /
Hurting by Gravity force HELP!!! ?
SO yo...im working on a new type of game...im using physics and rigidbody!!...i use AddForce for the movement...i made the health bar but i want enemies and my character to be damaged by the gravity impact force!! i need a script for that!!
Answer by hotozi · Jul 22, 2012 at 01:46 PM
LOL...thx but i already did that!! when the character is grounded....the contact point!! when he hit the ground at an certain velocity he loose lives!!! but when he is loosing lives it never stop until he got no more lives...and another problem i dont how to make the damage relative to the force impact (or velocity.magnitude)well...that is my real problem!!..?
but when he is loosing lives it never stop until he got no more lives...
show whole code where you decrease lives
and another problem i dont how to make the damage relative to the force impact (or velocity.magnitude)well...that is my real problem!!..?
http://docs.unity3d.com/Documentation/ScriptReference/Collision-relativeVelocity.html
Answer by ScroodgeM · Jul 22, 2012 at 09:21 AM
this issue needs some more then just script
first you need check 'use gravity' option in rigidbody objects second you need make colliders on all objects that can't be went through - like ground and walls third you need a script that gets impact and apply damage to object based on it, here is a good example:
http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnCollisionEnter.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Enemy Health With Raycast Not Working 1 Answer
Player Health and Death 1 Answer
Enemy Ai Problem with the collider and gravity 1 Answer
Enemy healthbar script 2 Answers