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
2
Question by user-4347 (google) · Oct 16, 2010 at 07:28 PM · damagemeshcollidershoothit

How can I do an enemy damage with different parts of the body?

I have an enemy in my scene where I want that when I shot in a certain part of the body like the head, for example, the damage is greater than if he gave in the feet, in few words in some parts I will quit more and in others less. But I want to know what do you need to do in the enemy and where the script has to be and how have to be the scripts.

I really help. Please someone help me. Thaks for future.

Comment
Add comment · Show 1
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 Estevominador · Jun 14, 2012 at 12:51 AM 0
Share

you can declare the colliders, for example: the head, if bullet hit the collider "head" then, multiply the damage for 5, for example.

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by chemicalvamp · Jan 04, 2012 at 10:19 PM

I would use a custom made low-poly collision mesh for each of the different damage areas, Or perhaps one for each body part then you can also make multiple body part versions to show localized damage.

Comment
Add comment · Show 1 · 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 cowlinator · Jun 14, 2012 at 01:40 AM 0
Share

It depends on how your enemy is set up.

The important part is to have one Collider component for each body part you want to take damage. Each GameObject can only have one Collider, so you will need a GameObject for each Collider.

If your enemies are animated, and if the animation skeleton is exposed in unity (the transforms which deform the mesh), you can attach a Collider to each bone.

avatar image
0

Answer by UNITY3D_TEAM · Jun 14, 2012 at 11:57 AM

use box collider to detect the different part of the body.u can edit the size of collide r .to achieve ur goal

Comment
Add comment · 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
0

Answer by JayPnchl · Dec 27, 2019 at 11:31 AM

i made a system which consists of enemies with 3 different parts of the body with red color (1)if the player hits the red colored part, the enemy takes damage.( till this it is done) (2)if the player hits the non-red colored part twice, i want to spawn another enemy at the same spot ( i have no idea how this will be done).

I have used rays to detect my enemies red colored part by getting the hitinfo and comparing the tag with enemy and using the isTrigger method to detect the red part

to instantiate i have used two spawning points which spawn 3 different types of enemies every 7 secs

help me with the (2)

Comment
Add comment · 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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Bullet scripting , i need help 1 Answer

Error in script to make a monster shoot against the player 1 Answer

Armour / Damage System RPG-like? 2 Answers

How to spawn an object with an added force 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