Log in or register to post comments

Bug - MultiTargets Background Video scale bug 7.2.23

September 20, 2018 - 1:14pm #1

MultiTargets seem to cause the camera background video plane to be way too zoomed in? 

 

Bug - MultiTargets Background Video scale bug 7.2.23

September 21, 2018 - 3:22pm #4

 

hack for resizing ondevice video re-scaling... note the multiplier is just from testing on the latest iPad... not sure how the scaling changes with device 

 

 

 

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using Vuforia;

public class BackgroundPlaneAdjust : MonoBehaviour {

    public Camera camera;

    public BackgroundPlaneBehaviour backgroundPlaneBehaviour;

    static Vector3 scale=Vector3.zero; static bool set = false;

private void Start() {

        backgroundPlaneBehaviour = camera.GetComponentInChildren<Vuforia.BackgroundPlaneBehaviour>();

}

void Update () {

        if (scale.magnitude == 0) {

            if (Input.GetMouseButtonUp(0) || (Input.touchCount >= 1 && Input.GetTouch(0).phase == TouchPhase.Began)) {

                backgroundPlaneBehaviour.transform.localScale *= .1667f;

                scale = backgroundPlaneBehaviour.transform.localScale;

                set = true;

            }

        }

}

private void LateUpdate() {

        if(set)

        backgroundPlaneBehaviour.transform.localScale = scale;

}

}

Bug - MultiTargets Background Video scale bug 7.2.23

September 20, 2018 - 6:42pm #3

The fix only sees to work in the editor :-( 

 

not sure how the video plane works or video scale resolution on iOS device... any help please? 

Bug - MultiTargets Background Video scale bug 7.2.23

September 20, 2018 - 3:55pm #2

Here is a temporary workaround that's a bit hackish.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BackgroundPlaneAdjust : MonoBehaviour {

public Camera camera;

void Update () {
if(Input.GetMouseButtonUp(0) || ( Input.touchCount>=3 && Input.GetTouch(0).phase == TouchPhase.Began ) ){
Resize();
}
}

void Resize(){
camera.transform.Find("BackgroundPlane").localScale *= .1667f;

GameObject.Destroy(gameObject);
}

}

Log in or register to post comments