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 DoubleIsLoveDoubleIsLife · Jan 12, 2015 at 05:23 AM · physicscolliderhitboxhealth-deduction

Fastest way to add calculate damage on different body areas (hit boxes)

What I ask is, what is the fastest way to replicate hit-boxes, like for headshots? I am currently using box colliders for my characters but it really lowers the performance. With about ten characters in my scene the FPS drops from 300+ to <100.

I know it is the colliders because when I disable all the colliders, but keep all the animations and AI running, the FPS shoots up to 300+ again. What would you guys suggest to replace my box colliders or improve the performance?

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
1

Answer by Taxen0 · Jan 12, 2015 at 09:07 AM

Colliders is the way to go, I can't think of any other way to do this.

Performance should not be an issue, i have a scene with a few thousand objects with colliders and it works fine.

Have you added a rigidbody to the characters, or made the colliders static?

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 DoubleIsLoveDoubleIsLife · Jan 12, 2015 at 11:58 PM 0
Share

I have tried adding rigid-bodies, but that made it slightly slower for me. Would adding rigid-bodies be better if I marked the limbs as static?

avatar image Taxen0 · Jan 13, 2015 at 08:44 AM 1
Share

moving static colliders is very heavy on the CPU, and a collider without a rigidbody counts as static if I'm not mistaken.

So have one rigidbody on your object and then add the colliders (not static). You can also make sure the colliders only check for collisions with relevant layers, see this article from the Unity $$anonymous$$m: http://unity3d.com/learn/tutorials/modules/intermediate/physics/physics-best-practices

avatar image DoubleIsLoveDoubleIsLife · Jan 14, 2015 at 09:01 AM 0
Share

This is strange, I put a rigid body on the main object, then set the physics of the hitboxes to ignore everything. Problem is, with rigid body = 30-40 FPS without rigid body = 80-90 FPS.

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

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OnCollisionEnter isn't working between two RigidBodies 1 Answer

My object falls through terrain. 8 Answers

Character Controller Pushes Car With Wheel Colliders? 0 Answers

Best collision detection method? 2 Answers

How do I detect current collisions without using onCollisionEnter? 0 Answers


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