r/oculusdev • u/statypan • Jun 29 '22
Stuttering when turning as player continuously
Hey guys - I hope someone can help me out. I am developing a game, where the player is flying (using wings). Player can steer using their hands with continuous "turning". This is simply implemented as rotating the parent object (XRRig - the Character Controller game object) - more specifically just applying rotation using Quaternion in the Update method (with help of Time.deltaTime). The issue is that when turning in this manner, I experience "stuttering", where sometimes (every few seconds), it "stutters" (it looks like one frame was wrong or something like this). And I dont think it's connected to overloading the CPU/GPU, because I am monitoring this and they are faaaar from reaching 100% usage (CPU/GPU level is 2/2 and CPU / CPU usage is 30 / 80 max). I excluded shaders, individual objects or even individual scripts (I could see this behaviour in vary different scenes, using simple shaders / meshes). Also my script for rotating the XrRig is not the issue - when I disable it and just use a simple script that continously rotates the player, the same thing still happens. Any idea would be appreciated :)
View all comments
Show parent comment
2
u/statypan Jun 30 '22
Thanks - I really appreciate your input.
It's Quest Standalone build. Fixed time step was 0.02, I changed it to 0.0138 - did not see a big diff.
I use CharacterController on the player rig, there is no rigidbody. I have kinematic rigidbodies on hand prefabs, but even disabling those does not affect it.
Nothing is instantiated at runtime either. Weird thing is - when I rotate my head, there is no stuttering. When I rotate the player (I use transform.localRotation = Quaternion.Euler(0,delta,0) * transform.localRotation), the stuttering occasionally happens. And even if there is almost nothing in the scene. So maybe this way of doing rotation is not a good one?
Edit: actually I am using transform.RotateAround() function at this time, but the mentioned method does the same thing.