Reproduction steps:
1. Open the attached "PROJECTFILE" project
2. Open the "Assets/Scenes/SampleScene.unity" scene
3. Enter the Play mode
4. Press the “2” keyboard key to switch weapons
5. Hold the left mouse button and wait for about 40 seconds
6. Observe the Game view and the Console
Expected result: No game freezes and no Console errors
Actual result: The game freezes and Console errors “IndexOutOfRangeException: Index was outside the bounds of the array." are thrown
Reproducible with: 2022.3.21f1
Couldn't test with: 2021.3.36f1, 2023.2.13f1, 2023.3.0b10 (Project does not fully load, Console errors)
Reproducible on: macOS Sonoma 14.3.1 (M1 Max)
Not reproducible on: No other environment tested
Note:
-The game occasionally unfreezes