- Home /
Jittery camera motion in GearVR when moving camera - nothing seems to work.
I have a very simple scene that runs at a very high frame rate, but when I try to make the camera move, the movement is jittery causing it to look like a very low frame rate.
I have read elsewhere about moving the camera in FixedUpdate, LateUpdate, or Update, but nothing seems to work.
I have also tried setting Application.targetFrameRate in Start(), and also QualitySettings.vSyncCount = 0; I have also tried using a normal camera and the OVRCameraRig.
Nothing seems to work from what I have read. In the editor, there doesn't seem to be this problem, only when compiling and running on GearVR (and using a bluetooth joystick to control movement).
Here is the code that I am using to move the camera. The Camera is placed as a child of an empty GameObject with the following script attached to the GameObject:
using UnityEngine;
using System.Collections;
public class SimpleCameraMove : MonoBehaviour
{
Camera cam;
Vector3 origPos;
Vector3 pos;
float controllerSpeed = 0.5f;
float displacement = 0f;
void Start()
{
cam = Camera.main;
origPos = this.transform.position;
}
void Update()
{
displacement += Time.deltaTime * controllerSpeed * Input.GetAxis("Horizontal");
pos = new Vector3(origPos.x + displacement, origPos.y, origPos.z);
transform.position = pos;
}
}
I am sure others must have been having this problem, and I have searched around but none of the solutions I have come across have worked. Please help.
Answer by benjaminoutram · Feb 24, 2017 at 09:32 AM
I figured out the solution! It seems that the environment I had created was working fine on a decent computer, but was struggling very hard to run on the Galaxy S6 (even though it was a very simple scene - maybe there were some things that were not optimized for mobile in it). I was fooled into thinking that it was running at a faster frame rate than it actually was because of the technique that is used to reduce simulator sickness of moving the frozen frame in front of the user as the user moves. However, moving the camera in the scene reveals the slow frame rate.
The solution is to optimize the scene or use a simpler scene, or use a profiler of some sort to check the actual frame rate of your app on the android device. Don't get fooled by the (very effective) simulator sickness reducing tricks.
Answer by Unity-Nikos · Feb 12, 2017 at 05:52 PM
Had the same issue till a few hours ago. Try setting both Fixed Timestep and Maximum Allowed Timestep to 0.0166666 in TimeManager Settings and Application.targetFrameRate = 60. Then also experiment with FixedUpdate
More info here https://developer3.oculus.com/documentation/game-engines/latest/concepts/unity-build-android/
Thanks for your response. This has not fixed the problem for me. I am going to try remaking the app for another platform and see if I get the same issues elsewhere. In addition, following the advice on the instructions in that link, specifically the one to do Tools > Oculus Create store-compatibile Android$$anonymous$$anfiest.xml created an error at compile to Android time.
Your answer
Follow this Question
Related Questions
Movement jitter every few seconds 1 Answer
Jittery Movement - specific mechanics in mind 0 Answers
Jittery FPS Camera when moving 3 Answers
Gravity controller is buggy 0 Answers
jittering when moving 3 Answers