Shooting Object

Hallo guys,

I want some object example ( weapon) shoot at enemy and if it kill 3 enemies the object will get extra life and if the object get shoot the life will decrease.

for example the object shoot 3 enemies it get 1 extra life and shoot other 3 then the life will be 2 , and if someone shoot the object the life will be 1 and if it reach 0 it will be destroyed

how can i make script for that ?

i wait for your answers , thank you :wink:

Is the object carried by the player? is it a static turret?

Need more information other than it shoots…

Does it shoot towards mouse position?

Towards the player?

Towards Enemy?

The object is the player
Yes, it shoot towards the mouse position and , lets say for example the object is cube(player) and it shoot small spheres towards another cube(Enemy player) if it touch the other cube it will desroyed but it need 2 more kills to get extra life and in case it get extra life and someone shoot it the life will instantly decrease

thx for your answer

http://unity3d.com/learn/tutorials/projects/space-shooter/creating-shots?playlist=17147

http://unity3d.com/learn/tutorials/projects/survival-shooter/player-health?playlist=17144
in particular the relationship between TakeDamage() and Attack()

for the lives approach you can see an example of discrete “lives” handling in this live training (pun unintentional :slight_smile: )
http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-breakout-game

1 Like

Thx bro for the information i’ll check it

Anyone have more information ?

You really need to break this down into smaller tasks.

  • Move a projectile toward a target
  • Detect collisions
  • Count collisions
  • Increment a value on another script

These tasks are pretty straight forward and can be googled.