I already have healtbar script but i dont know how to make an damage to it…
Any ideas…
Please help.
I already have healtbar script but i dont know how to make an damage to it…
Any ideas…
Please help.
Can you give us some more specified information so that we can give you a better answer? Can you post your healthbar script, for example?
I have uploaded it here http://forum.unity3d.com/viewtopic.php?t=51603&highlight=
please respond…
Please note I have only started working in Unity.
When it gets to this point in my game I guess I would start with grounded. Make a method to get the last grounded y axis (using if grounded)and when the player becomes grounded again get that y-axis. Store the two y-axis’ in a float – just var but it will become a float if using javascript. Then subtract the first y-axis (the first I mentioned)with the second. Now with trial and error subtract health off the player if the difference between the to is high enough. Example if the difference is 10 subtract 1 hp from the player.
pseudo code
if button jump
get y-axis
firstGrounded = y-axis
jump
when grounded again get y-axis
secondGrounded = y-axis
damageChecker = firstGrounded - secondGrounded
if damageChecker == exampleNumber
subtract damage from health
I Cant Understand That Where I Have To Copy It And How
It’s pseudo code, so what you need to do is read it carefully, understand it and retype it in javascript. It’s the only way to learn the language, mate ![]()
sorry but… im beginner and im not good in english but cant u make it more easier for me… ???