By mrpmorris
on Sat, 08/25/2018 - 18:04
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
I'm looking to buy a licence
I'm looking to buy a licence if I can solve this problem. Am I likely to get some help?
Hello mrpmorris,
Hello mrpmorris,
What version of Vuforia are you using currently and what version were you using in the past that didn't encounter this issue? Are you using the positional device tracker in your current project?
Thanks,
Vuforia Engine Support
Thanks for your reply
Thanks for your reply
My current version is 7.2.24
Track Device Pose is off. If I enable rotational tracking it crashes on my phone, if I enable positional tracking the FPS drops from 20 to 10.
Wow, is this really how poor
Wow, is this really how poor Vuforia support is? This is terrible!
I'm unclear what you're
I'm unclear what you're trying to do with this script. The camera is controlled by Vuforia and the device's camera. I deployed your project to a Galaxy S9 and saw no difference in the camera feed compared to a different project without your camera code. I did not see any flicker either.
It looks like the Vuforia
It looks like the Vuforia approach has changed. Previously the camera moved and rotated, now it seems it is the ImageTarget that moves and rotates.
This is dependent on what the
This is dependent on what the World Center Mode is set to. You can modify this on the Vuforia Behaviour.
Thanks,
Vuforia Engine Support