Armed and Dangerous

Read Time:1 Minute, 14 Second

Step one is to get our zombie to chase us if we attack it even if it is out of range. To handle this I created a new component called Aggression which has a pair of events attached to it: Aggro Started and Aggro Ended. These are responsible for toggling the Search For Target component. Aggro Started is a custom Unity Event that passes the offending transform which Follow Player can use to set the target.

Attack with Provocation

Hey, do NOT change the center of the capsule collider. The FPS controller out of the Standard Assets pack does not know how to deal with this. Instead, adjust the y-position of everything by half the height if you are going to make adjustments. The video below shows how I handled positioning the camera and guns using a prop model from the Synty Apocalypse pack.

Exercise your 2nd amendment right to carry during the Zompocalypse.

And finally we raycast to hit the Capsule which generates aggro and makes some noise. The gunfire is controlled using ring buffers attached to each weapon type.

If you liked it then you shoulda put a ring on it!

And here is the modified One Off Sound FX script to cache the countdown just one time and then simply restart the coroutine On Enable. Nothing else needs to happen since the sounds play On Awake (which is actually On Enable).

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleppy
Sleppy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *