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 Om3n 2 · Dec 20, 2010 at 08:26 PM · raycastcolliderdynamic

Unity and Raycasting/collision

Is there a limit to the collision detection that can happen between two objects? I have a cube and a ball in a game im working on, controller would be the cube as you move it around and direct the balls trajectory. For some reason when i move the cube too fast it ejects from the cube then goes on its merry way. Ive tried using the new dynamic colliders in unity 3 as well as tried a raycast to stop the ball from leaving the cube. Any insight/input would be appreciated.

Comment
Add comment · Show 3
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 Om3n 2 · Dec 24, 2010 at 04:41 AM 0
Share

Really? not one person? =( Thanks anyways.

avatar image Tommynator · Sep 30, 2011 at 01:33 PM 0
Share

Please specify again how your scene is setup. It's not clear how the cube and the sphere are connected and how you make use of the physics engine.

avatar image cregox · Dec 07, 2011 at 01:52 PM 0
Share

similar: http://answers.unity3d.com/questions/22351/colliding-fast-moving-objects-position-in-last-fra.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by cregox · Sep 30, 2011 at 02:08 PM

The only limit to the collision detection would be hardware, since colliders may hit very hard on performance. Specially mesh colliders.

And raycasting actually is your best bet.

Your question should rely mainly on the "too fast", and there are many many questions on that already. Here's my favourite.

In short, just use DontGoThroughThings. For more details, I'll quote myself from there:

The problem exists even if you use continuous dynamic collision detection because fast moving objects can move so fast that they are too far apart from itself from one frame to the next immediate frame. It's like they teleported and no collision detection would ever be triggered because no collision existed, from each frame perspective, and thus from all calculations processed.

Comment
Add comment · Show 6 · 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 attiksystem · Oct 17, 2012 at 01:49 PM 0
Share

For un unknown reason, DontGoThroughThings fails when deploying my app to iOS...

avatar image cregox · Oct 17, 2012 at 02:10 PM 0
Share

@attiksystem I've used it in iOS and I tend to doubt it's an issue with the script. Can you give more details?

avatar image attiksystem · Oct 17, 2012 at 02:18 PM 0
Share

Hi, sure. When attaching DontGoThroughThings to my object (Cloth Renderer, I'm not sure this has an effect), and deploying to iOS, it bombs at line 0x81a0, with error "Thread 1: EXC_BAD_ACCESS (code=1, address = 0x0)". Using Pro version of the tools, latest version of everything.


unity`DontGoThroughThings_Awake:
0x80bc:  mov    r12, sp
0x80c0:  push   {r7, lr}
0x80c4:  mov    r7, sp
0x80c8:  push   {r8, r10, r11, r12, lr}
0x80cc:  sub    sp, sp, #260
0x80d0:  mov    r11, sp
0x80d4:  mov    r10, r0
0x80d8:  add    r0, r11, #8
0x80dc:  mov    r1, #0
0x80e0:  mov    r2, #24
0x80e4:  bl     0x9060                    ; p_2
0x80e8:  mov    r0, #0
0x80ec:  str    r0, [r11, #32]
0x80f0:  mov    r0, #0
0x80f4:  str    r0, [r11, #36]
0x80f8:  mov    r0, #0
0x80fc:  str    r0, [r11, #40]
0x8100:  add    r0, r11, #44
0x8104:  mov    r1, #0
0x8108:  mov    r2, #24
0x810c:  bl     0x9060                    ; p_2
0x8110:  mov    r0, #0
0x8114:  str    r0, [r11, #68]
0x8118:  mov    r0, #0
0x811c:  str    r0, [r11, #72]
0x8120:  mov    r0, #0
0x8124:  str    r0, [r11, #76]
0x8128:  add    r0, r11, #80
0x812c:  mov    r1, #0
0x8130:  mov    r2, #24
0x8134:  bl     0x9060                    ; p_2
0x8138:  mov    r0, #0
0x813c:  str    r0, [r11, #104]
0x8140:  mov    r0, #0
0x8144:  str    r0, [r11, #108]
0x8148:  mov    r0, #0
0x814c:  str    r0, [r11, #112]
0x8150:  mov    r0, r10
0x8154:  bl     0x9070                    ; p_3
0x8158:  str    r0, [r10, #16]
0x815c:  mov    r2, r0
0x8160:  add    r0, r11, #224
0x8164:  mov    r1, r2
0x8168:  ldr    lr, [r2]
0x816c:  bl     0x9080                    ; plt_UnityEngine_Rigidbody_get_position
0x8170:  add    r0, r10, #40
0x8174:  ldr    r1, [r11, #224]
0x8178:  str    r1, [r0]
0x817c:  ldr    r1, [r11, #228]
0x8180:  str    r1, [r0, #4]
0x8184:  ldr    r1, [r11, #232]
0x8188:  str    r1, [r0, #8]
0x818c:  mov    r0, r10
0x8190:  bl     0x9090                    ; p_5
0x8194:  mov    r2, r0
0x8198:  add    r0, r11, #8
0x819c:  mov    r1, r2
0x81a0:  ldr    lr, [r2]
...

avatar image cregox · Oct 18, 2012 at 11:30 AM 0
Share

@attiksystem no render should present any effect on this. the "line" the assembly code doesn't help as I'm not fluent in it. also EXC_BAD_ACCESS tells me nothing without knowing what was in the original (rather than assembly) line that triggered it - since I don't have a "knowledge base" of the script possible errors... I advice you to create an empty scene, free of errors, and little by little build and test something that can emulate what you need. Then attach the script. If, by any chance, you find any errors there, you'll have a much better idea what could have caused it.

avatar image attiksystem · Oct 18, 2012 at 11:43 AM 1
Share

Thanks. I'll try that. But meanwhile, I found another trick in order to avoid objects to "go through" other objects: make one of them very thick. This might not work all the time, but for my particular application, it does!

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Get color pixel from terrain, with a WheelCollider! 1 Answer

Physics.Raycast not hitting anything 1 Answer

raycast doesn't collide on anything? (C#) 2 Answers

Detect only UI button click 3 Answers

Can you create a dynamic box collider? 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