Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Michael 12 · May 16, 2011 at 01:31 AM · fpsenemyhealth

Head Shot = Instant kill for FPS enemies

My "Alien Zombies" have nice big fat heads and I'm wondering if it's possible to make it so that if they were shot in the head it would be an instant kill? As it is right now they have 100 hitpoints and my shotgun does 50 damage so it takes two shots to kill them which is fine. But I was thinking it would be more interresting or a bit more difficult if maybe I gave them some more hit points but somehow made it so that a head shot was an instant kill. Don't know if that's possible or not. They are animated characters made in Max 8 so they have a biped if that helps information wise any ;)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Dreamer · May 16, 2011 at 01:36 AM

1 If your head is individual part of the zombie model, you just tag it to be "Head". When collision happens, if bullet is colliding with head, you give it 100 damage.

2 If your zombie model is all together. You could create a sphere collider with mesh rending disabled and place it at zombie head and make tag to "Head". Rest is same.

Add: That depends on how you calculate damage. If you use a collision detect way with bullet. You could add below script to your bullet:

function OnCollisionEnter(collision : Collision) {
if(collision.gameObject.tag=="Head")
   Player.DoDamage(100);
   Destory(this.gameOjbect);
}
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ziC · May 16, 2011 at 02:41 AM 0
Share

This sounds like the best id thanks for cool info!

avatar image Michael 12 · May 16, 2011 at 06:43 PM 0
Share

Well like I say my alien's body is a single mesh with a biped skeleton inside that controlls the animation. I did manage to attach a sphere collider to the the Biped head and tag that as "Head" Now where would I make my code adjustments? Would I make them to the shotgun script and if so How?

avatar image Dreamer · May 17, 2011 at 02:59 AM 0
Share

Add in my answer

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Shooting and health Help 0 Answers

Deal damage on collision 2 Answers

How to create Enemy Health Bar ? 4 Answers

One enemy triggers all the enemies 2 Answers

Health Script 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges