|
I have been using Unity for about 2 weeks now and after brief knowledgeI am trying to make an FPS game and it requires only shooting. The way i want to approach is as follows:
The third step is doubtful . I was thinking that when mouse is clicked then the name of the organ colliding with the ray is stored as a string this maybe can be done by keeping different name for chest, head, arms, legs etc. Then its passed on to a Javascript associated with the enemy and it checks: if the string is "leftArm" then it plays some animation and health drops by 20% or if "rightLeg" then something else and health drops by something else. But there is a problem that even when i am reloading the gun keeps shooting how to rectify it? Are there any other problems that i might face due to this? Since i am new to this i have a small doubt. If i have something like this :
Do the animation and sound take place simultaneously or is it like first the animation occurs and then the sound plays? Sorry for a big post..... i am very new and its my first question!
(comments are locked)
|
|
Its a long time but i may answer in case someone else wonder on to this. You could set up a counter so when it is a certain amount stop firing. For example (C# Coding) int BulletsInGun = 40; in your gun fire code(fired add //EnegyInGun. (could be more appopriate if you ain;t using bullets). BulletsInGun ++; and if(BulletsInGun > 0 ) { Do your gun code. } else { Do Reload code. (You can do this to allow automatic reloading) or set it to button press. }
(comments are locked)
|
