I used to use a script on my AR Camera that would smooth the motion in the MonoBehaviour.LateUpdate method. In earlier versions this worked great, but in the latest version it seems Vuforia sometimes (but not always) sets the camera position back afterwards.
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class CameraAdjustment : MonoBehaviour
{
Camera Camera;
private void Start()
{
Camera = GetComponent();
}
private void LateUpdate()
{
int seconds = Mathf.FloorToInt(Time.time);
if (seconds % 2 == 1)
Camera.transform.Rotate(new Vector3(20, 0, 0));
}
}
This simple script will try to alter the camera's rotation for one second every two seconds. If you run this on a phone (Android in my case) it is smooth for one second when not trying to alter the rotation, and then for the next second it will flicker between the angle Vuforia set and the new rotated angle.
How can I stop this flickering? As it stands I cannot add my own smoothing technique due to this flicker.
I have attached a full example Unity project.
Thanks
Attachment | Size |
---|---|
![]() | 3.68 MB |
This is dependent on what the World Center Mode is set to. You can modify this on the Vuforia Behaviour.
Thanks,
Vuforia Engine Support