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 Helkus · Jan 31, 2011 at 08:53 PM · iosperformance

iOS Collider Performance?

Hey all, I've got a grid of objects 100 seperate objects for a 2d game on iOS. I'm using a raycast when I tap to select the objects (each object has its own box collider)

My question is if it's expensive to have a box collider on the objects even though they are idle 99% of the time and do not use any type of physics, they do, however move via transform.position = newpos and end up intersecting eachother at points.

Is there any kind of performance penalty associated with doing this? Again, I'm not using any sort of physics, just the collider for raycasting to hit when a player taps the screen. Thanks!

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
6
Best Answer

Answer by Jessy · Jan 31, 2011 at 10:18 PM

Moving colliders without rigidbodies is actually a very bad idea, performance-wise, because it forces PhysX to recalculate whatever is necessary, for static colliders. Put kinematic rigidbodies on them and you should experience as good of performance as possible.

Comment
Add comment · Show 7 · 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 Helkus · Jan 31, 2011 at 10:44 PM 0
Share

Thanks for your answer, I will give that a try but I wanted to ask first, what do you think would be faster, converting all objects to viewport space coordinates, and checking which is closest to the mouse position/touch position, or what you are suggesting and using the ray still, Thanks a tonne

avatar image Jessy · Jan 31, 2011 at 11:22 PM 1
Share

Not using raycasts will be faster if you have a relatively static scene. I'd have to know more about what you're doing to make a good recommendation, but raycasting is probably only a good choice if you have a camera that's moving around through the scene, or your objects have shapes that don't lend themselves well to fast shape checks, like circles and screen-aligned rectangles.

avatar image Helkus · Jan 31, 2011 at 11:41 PM 0
Share

it's a static 2d puzzle, 10x10 grid of objects, all currently with cube colliders,

Basically I want 0 overhead from the colliders aside from when I pick the object, so are we leaning towards removing them and doing the screenspace check ins$$anonymous$$d?

avatar image Helkus · Jan 31, 2011 at 11:44 PM 0
Share

$$anonymous$$eep in $$anonymous$$d the objects themselves are moving via transform.position so they are intersecting, I was worried the colliders would have an overhead due to this, even though there should be no collision of any kind behind them (the colldiers are ONLY for ray picking)

avatar image Helkus · Feb 01, 2011 at 01:34 AM 1
Share

Thanks for all your help, it's definately faster with the kinmatic rigid body, I'll reply with the results of my solution too, giving that a shot now

Show more comments

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

1 Person is following this question.

avatar image

Related Questions

CaptureScreenshot 1 Answer

Mesh collider cost 1 Answer

poor performance is slowing down the rate 1 Answer

Can Apps ask for CPU power? 1 Answer

iOS - Multiple Textures Slow Performance 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