Skip to content

Commit

Permalink
add workaround for main menu change that happened
Browse files Browse the repository at this point in the history
  • Loading branch information
Happyrobot33 committed Sep 24, 2024
1 parent 6176f49 commit 0204e70
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ private bool IsMainMenuOpen()
const int layer = 2 << 18;
//swapped from OverlapSphere to OverlapSphereNonAlloc, as it does not allocate memory each time it is called,
//saving on garbage collection. Also doesnt require a .Length check, as it returns the number of colliders it found inherently.
int uiColliderCount = Physics.OverlapSphereNonAlloc(LocalPlayer.GetPosition(), 10f, _colliders, layer);
//Second note, instead of using localplayer position, we use the head position, as the player position can desync depending on Holoport and VRC changes.
int uiColliderCount = Physics.OverlapSphereNonAlloc(LocalPlayer.GetTrackingData(VRCPlayerApi.TrackingDataType.Head).position, 10f, _colliders, layer);
//commented out due to extern count, this uses 3
//return uiColliderCount == 8 || uiColliderCount == 9 || uiColliderCount == 10;

Expand Down

0 comments on commit 0204e70

Please sign in to comment.