Forum Discussion
MolluskJesse
9 years agoExplorer
Unity 5.3.4p1 - Warning regarding Hard-Crash Error Tranform.LocalPosition and VR
We have experienced an Access Exception crash error when working in VR with Oculus SDK 1.3 in Unity 5.3.4p1. While we have already figured out a solution for this issue, we wanted to post about it here in case anyone else experiences similar issues.
For some context, our VR cameras are parented under a VRPosAdjuster gameobject. We do this to get around the fact that Unity's VR camera's don't seem to allow VR Cameras’ origin points to be adjusted unless they are parented under something.
In the script that controls the VRPosAdjuster, we were setting its LocalPosition variable in our LateUpdate loop, including the very first LateUpdate call when a scene was loaded at runtime.
This situation was leading to a race-condition-like error that was experienced on certain machines. The error was a Access Violation (0xc0000005) error and this sample of our callstack shows it was coming from the LocalPosition set.
0x00000000224E582B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Transform:INTERNAL_set_localPosition (UnityEngine.Vector3&)
0x00000000224E5775 (Mono JIT Code) UnityEngine.Transform:set_localPosition (UnityEngine.Vector3)
The solution we found was to simply wait a few frames at the beginning of each level before trying to set the LocalPosition variable to avoid that race-condition-like error we were experiencing. So, if anyone else is experiencing this, just try and put in a few frame delay and that should help alleviate the issue.1 Reply
Replies have been turned off for this discussion
- vrdavebOculus StaffThanks for reporting this. We'll take a look.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago