Contact Receiver Box with Face Proximity calculate the Incorrect Distance
tracked
DX_30
I was trying to do the following setup (indicated in the image) to be able to create a pointer to select items in a menu.
I noticed that the pointer (in the test case, a contact sender type Box) doesn't calculate the interaction between the cursor and the contact receiver correctly.
In my tests, it seems to creates a bonding box around the cursor and calculates based on that, thus showing a proximity that is not consistent with the intersection of the sender with the receiver.
This bug affects all currently available versions: public, open beta, Unity-6 and SDK
here an an avatar with a example of the bug:
and here the link for a VRCfury prefab with the setup:
*Note: If you change the cursor type from box to Capsule, the receiver stops working completely, this is also not expected behavior.
Photo Viewer
View photos in a modal
Log In
lackofbindings
Basically can't use box contacts for anything until this is fixed. Most contact senders in the wild are capsules, if boxes don't work with capsules they can only be used for extremely specific local cases. To be clear its a lot worse than just the distance calculations, see the posts that (maybe a bit too liberally) got merged in.
Dexvoid
Merged in a post:
box contact face proximity unexpected behaviour
WalooW
SDK 3.10.4-beta.2
face proximity seems to be chosing it's distance to be the closest point the contact get to the face's plane even if that point is outside of the box, this is noticable when the receiver is smaller then the sender as it gives seemingly wong data.
in the picture below i am trying to make a "raycast" analog for contacts with a 0-width/height box contact, that on it's own work fine but grazing the edge of the sender sphere make the small red sphere jump all the way to the closest point of the sender instead of following the sender's surface, (so it seems that sphere appear as a cylider from the sender's POV)
i understand this is probably much simpler and more optimised for it to behave like that than to check for the clossest point withing the box but it's not how we would have expected it to behave and sudstantially limits it's potential
if getting the proper distance withing the bounds of the box is not an option it would be nice to have at least something to cover the 0-width/height/"ray" box edge case, so it would behave more like a raycast
Photo Viewer
View photos in a modal
Dexvoid
Merged in a post:
Box Contact fails to register contact with long capsule contacts under some circumstances
RuneFox237
Found an issue w/ box contacts where some setups of box contacts, specifically thin but large ones, may fail to register contact with long but small radius capsule contacts.
Link to a public test avatar that reproduces the bug:
The public test avatar has meshes that are accurate to the contacts which also react to the contacts touching.
Steps to reproduce:
- Add a box contact Receiver which is long and wide but thin on one axis.
- Add a capsule contact Sender which is long with a small radius
- With the contact overlay open move the contacts around and test contact between the two
- Observe that it works when the capsule is touching the edges of the box contact but sometimes does not register contact when the capsule is placed in the middle of the box contact and rotated so that it is not perpendicular to the surface of the box contact.
The contacts correctly register collision in these circumstances:
* Capsule is touching an edge of the box contact
* Tip of capsule is touching any part of box contact
* Capsule is contacting somewhere in the center of the boxes face and is perpendicular to the face
Contacts do not register collision in this circumstance:
* Capsule is contacting the box in the middle of the capsule, capsule is NOT perpendicular to the face(s) it is intersecting with, Tips of the capsule are not touching the box.
My best guess as a hobbyist dev based on what I'm seeing here is that the math for detecting the closest point on the line defined by the capsule contact might be returning an incorrect value.
Attached Files:
The attached file is a video showcasing the bug. Note the contact stops working when the capsule is inserted into the middle of the box contact at an angle
StormRel
updated the status to
tracked
DX_30
From my research, it seems to have something to do with scale, both the scale on the contact receiver component and the gameobject.
Changing the scale of the X and Y axes does not change how the distance is calculated.
The Gizmos visuals are updated, but the calculation doesn't appear to use the same information.
It's probably something left over from the capsule and sphere code, it ignores the scale of the gameObject if the scale is not uniform.
RuneFox237
This may be related to the issue I found w/ long & wide but thin boxes interacting incorrectly w/ long and thin capsules as your note at the end would result a similar setup to what I had in my testing.
I should probably test that same setup w/ a box contact instead to see if something similar occurs.