Need Help About Health,Damage

Hi
I need some simple help as a newbie .
I am developing my first game and i need help that My player is a ball(like roll-a-ball tutorial player) and i want to assign that ball health .
and i also have enemy who always follow my player and i want when i touch to my player something like a … boom … particles and my player decrease some health (Is there any link of assets store particles that help me with this)

I need in c# please help me guys .

and one more thing … i will make my game commercial if it will complete so is there any issue if i use assets store free assets .(Please answer this question in brief yes/no because it’s not a big deal for me , the bigger problem is player health system Please help me there)

Hi,

What you want is the OnCollisionEnter() function. This checks when you collide with something, and then you can tag the enemy as an enemy in the inspector and check the tag ith collider.compareTag(“enemy”);

http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionEnter.html

If it is the enemy, just remove some amount of health from your player health variable.

As far as particle effects go, you could use a particle system and just enable and disable it again. The system itself can be configured in the inspector.

As to publishing your game, I would personally only make it commercial, if all the assets are yours, and the game idea is yours (i.e not a tutorial) just to make sure there are no copyright problems. But a ball shouldn’t be too hard to model and texture yourself. :slight_smile:

Good Luck,

Hope that helps :slight_smile:

IEMatrixGuy