Search Issue Tracker

Active

Under Consideration for 2021.3.X, 2022.3.X, 6000.0.X, 6000.1.X

Votes

11

Found in

2021.3.46f1

2022.3.53f1

6000.0.28f1

6000.1.0a6

Issue ID

UUM-88080

Regression

No

Physics.Raycast fails when a Capsule Collider at a default position is used

--

-

Reproduction steps:
1. Open the attached “BrokenCapsule.zip” project
2. Open the “BrokenRaycast” Scene
3. Enter the Play mode
4. Observe the Raycast lines in the Scene view

Expected result: The lines are green and text “Hit” is visible above the capsule
Actual result: The lines are red and text “Miss” is visible above the capsule

Reproducible with: 2021.3.46f1, 2022.3.53f1, 6000.0.28f1, 6000.1.0a6

Reproducible on: Windows 10 (User reported), Windows 11
Not reproducible on: no other environment tested

Notes:
- Also reproduces in the Player
- Only reproduces when the capsule is in default position. The problem disappears when the capsule is rotated on X or Z axis or its position is changed
- Moving the ray's origin backwards along its direction and increasing its Raycast length does not change the result. Moving the origin otherwise or changing the ray direction does make the Raycast a correct hit
- Extending the rays further will create a hit when they reach the back face of the capsule
- When extending the length of these rays that miss, they all intersect the edge between the cylinder and bottom hemisphere
- Relevant discussions page: [https://discussions.unity.com/t/recreatable-incorrect-raycast-miss-on-capsule-collider/1556381/8|https://discussions.unity.com/t/recreatable-incorrect-raycast-miss-on-capsule-collider/1556381/8|smart-link]

Comments (2)

  1. zalogic

    Dec 13, 2024 12:12

    New extra info: the SphereCast fails or returns incorrect hit point with the CharacterController collider on Unity 6000.0.31 LTS.
    100% repro rate.
    It's not related to SphereCast on CapsuleColllider, it's with the CharacterController collider.

  2. zalogic

    Dec 11, 2024 17:35

    Apparently physics spherecast misses capsule collider with the upper or lower part even when not at the so called "default" position. At various other scene positions a capsule collider is missed by physics sphere casts at random times when targeted at different positions on it's surface from a fixed position.
    Happens on Unity 6000.0.30f1 LTS.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.