|
how do i make an enemy shoot at the player and if the player shoots at it. it'll die within 20 bullets.
(comments are locked)
|
|
In basic it is pretty easy. First you will need to make the script that stores the health and can be accessed by another scripts, so: Add this to the enemy and name the script enemyHealth:
Then we would want to create a new script that hurts the enemy: Put this on the camera:
This is untested so there may be errors. do i add both the scripts to the character or the enemy?
May 10 '11 at 01:53 PM
bob 7
how do i add a Raycast?
May 10 '11 at 01:56 PM
bob 7
there comes an error which is as followed "(10,5): BCE0005: Unknown identifier: 'EnemyHealth'.s"
May 10 '11 at 05:05 PM
bob 7
The script name and the name of the script inside the script HAS to be the same or else it wont work.
May 10 '11 at 05:57 PM
OrangeLightning
thank you ill test it out and if it works ill rate u. professnal orangelightning. :). gd boy
May 10 '11 at 07:23 PM
bob 7
(comments are locked)
|
|
go check the fps tutorial. it already features such a simple AI, modify health and bullet damage values to get to your 20 hits. http://unity3d.com/support/resources/tutorials/fpstutorial.html
(comments are locked)
|
|
For the enemy health just put Var Enemy health = 10;
(comments are locked)
|
|
for the enemyHealth just put (var enemyHealth = 10;
(comments are locked)
|
|
I am having this same type of issue and the fps tutorial sounds like it no longer works with the new unity. Is there somewhere else to try and look? Or if someone is just willing to listen to my new issue and help me out that would be cool too.
(comments are locked)
|
