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
1
Question by themusicdork · Nov 10, 2011 at 04:23 AM · rigidbodyraycastperformancespeedcollision-detection

RigidBodies vs CapsuleCasts

I've been tinkering with the Physics.CastAll functions to avoid the "costly" rigidbodies. After several rigidbody work-arounds (getting things to work without them) I've been debating whether to just put them in my game.![alt text][1]It's a Zelda Ocarina Of Time lookalike. So there wouldn't really be that many rigidbodies that need calculated for, but I want it to be playable on older machines.


So my question is this. Is using rigidbodies worth the performance cost? And how much is that cost compared to (say) CapsuleCastAll every step?

Comment
Add comment · Show 4
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 Owen-Reynolds · Nov 11, 2011 at 05:00 PM 0
Share

You mean you want to run your own code for "physics" movement and collisions? OverlapSphere or a short CapsuleCast would be used in your hand-written Collision tests?

avatar image themusicdork · Nov 17, 2011 at 05:24 AM 0
Share

Yes. I would like to know if a self coded "physics" code would be faster that just using a CharacterController and having that calculate collisions.

avatar image syclamoth · Nov 17, 2011 at 05:28 AM 0
Share

CharacterControllers are much slower than rigidbodies. Rigidbodies manage all the physics, making it much much easier to code for, but if you can model all the behaviour you need with raycasts do that ins$$anonymous$$d (since it'll be more stable anyway if you code it right).

avatar image themusicdork · Nov 17, 2011 at 03:01 PM 0
Share

So in order of speed (CPU usage) its, raycast (although caspsule cast sends many rays...) rigidbody, CharacterController. Alright. thanks for the help guys.

0 Replies

· Add your reply
  • Sort: 

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

Why is CapsuleCast/Raycast performance effected by rigidbody? 1 Answer

Possible to Give Rigid bodies collision bounding boxes? 0 Answers

How do I use a sphere collider to tell if my player is on the ground? 2 Answers

How to detect ground slope angles in 3d? 1 Answer

Can't use Rigidbody.AddForce to RaycastHit.point 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