|
OK so i'm making a zombie game and so far i have a zombie that will walk to me and i move it will turn but once it gets relly close it stops moving and won't start again? also how do i make it so when it's close to me lik a raange of 5, or 6 it will cause me 50 points damage after every 1.5 seconds it will damage again. help would be apriciatexd ohh sorry it moves because i put a waypoint atached to me so they follow the waypoint but it just stops when they get close to me?
(comments are locked)
|
|
Here's one script I used for that sort of problem.
it was pretty useful to get me going. should be pretty self explanatory. just comment if you have any questions Hey can i use this code to publish in my game? I am adding a game to the Mac app store and i need some code for the zombie? If you do allow i can give you a free copy... :) Thanks, Sam
May 10 '12 at 09:41 PM
samdogg7
i dont have health script so i dosent work very good anyone has health script that could work with this attack script?
Jun 03 '12 at 11:19 AM
GRZN
(comments are locked)
|
|
I think (just a thought) thatwhen the zombie reaches you, he reaches his destination. mission over. and then, he does nothing.
(comments are locked)
|
|
try this raycast; Physics.RayCast(transform.position,player.position,10); if (hit.distance<30) { //attack code here }
(comments are locked)
|
|
I would love some help that script works but i dont have a health script so? how do i actually get hit by the zombie? could anyone send me a health script if someone has worked that out would give you credits :)
(comments are locked)
|
|
The problem is that you set moveSpeed to 0 when the zombie reaches melee range without setting it back to 3 when you are away again.
(comments are locked)
|
1 2 next page »

Post the zombie script so we can see