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 markhula · Oct 23, 2011 at 12:17 PM · sweeptest

Does Sweeptest actually work?

Hi all,

I'm trying to do something real simple or so I thought. I wish to control the movement of a cube (box collider) so that it moves kinematically but stops when it collides with a mesh. I use sweeptest to check 'ahead' but either the object intercepts before the collision occurs or a collision is registered when they aren't colliding. The 'range' parameter seems a bit of a magic number. Any info and what is needed or how sweeptest works internally would be great.

Cheers

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
0

Answer by billunitydev · Feb 13, 2014 at 08:34 PM

I have struggled with the box/cube collider sweeptest for about 8 hours now.

I was getting what appeared to be "false positives" against a mesh collider (i.e. hits/collisions when I was not expecting them).

After about 3 hours of examination, I hypothesized that the box/cube sweeptest might be using the AABB (i.e. collider.bounds) for the sweep. However, after another 3 hours I disproved my hypothesis. After another 2 hours I just gave up trying to figure out what on earth the box/cube sweeptest was trying to do because I was out of ideas. Would love it if someone could actually describe the behavior accurately (and not just quote the unity reference because it's flat out wrong for boxes/cubes).

Instead I switched to a bunch of capsule sweeptests that would give me the same coverage and the results so far look good. Depending on the shape you are trying to sweep, a bunch of raycasts might be more appropriate.

-b

Comment
Add comment · 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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Sweep for vertex positions? 1 Answer

Any way to prevent sweeptest from colliding their triggers? 1 Answer

Rigidbody.SweepTest - Local or Global axis? 1 Answer

Why some types of colliders2D can't be hit be sweeps? 0 Answers

Moving and SweepTesting a kinematic Rigidbody multiple times within a single FixedUpdate() call 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