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 Waliactico · Jan 31, 2014 at 05:09 PM · androidcollisionphysicsiosefficiency

Efficient collision detection for a runner game

I'm making a 3D runner game for mobile devices (like temple run), and I want to know how should I check the collisions in an efficient way. In my game, there will be around a maximum of 15-20 obstacles active at the same time to check collisions with, plus some items/powers ups. All of them have simple colliders, like boxes or capsules. So, the question is, should I use... A) physics system (this is, onColliderEnter function, and all similar things). B) checking if colliders near to player overlaps with it every frame, with something such as: collider.bounds.Intersects(...) C) Some cast from the player, like a capsuleCast, or some rayCasts every frame and checking the distance of collision point. D) Any other option that I haven't thought of.

Thank you very much!

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 Lockstep · Jan 31, 2014 at 05:15 PM

Physics!

Unity uses the PhysiX engine by envidia. I'd say it is pretty optimized. Read the documentation on collider for information on how to set it up.

Comment
Add comment · Show 2 · 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 Waliactico · Jan 31, 2014 at 07:07 PM 0
Share

I know how to work with physics. What I'm not sure if it's the best solution for my project, since it's a game for mobile devices and everything must be optimized the most it can be. I'm a little scared that using physics some of the collisions may be undetected in some low-end devices(tunnelling), or maybe slow the game down

avatar image Owen-Reynolds · Jan 31, 2014 at 08:06 PM 1
Share

A grown-up collision system, which I assume Phys-X is, uses 20+ years of known speed tricks.

For example, an Octree groups the space into big chunks, and you only check your chunk for overlaps. So if you're nowhere near anything else, collision checks are 0 time. They were made to replace the "check everything every frame" method you proposed.

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

20 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

Related Questions

What is the best practice in handling scenes with 100+ rigidbodies and collisions on iOS? 1 Answer

Massive framerate fall with Character Joint 0 Answers

Is PhysX being used on mobile 1 Answer

Physic spikes after few seconds of gameplay on Android 0 Answers

What event gets called on resuming a game on mobile? 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