Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to use script to switch world center mode after scene loaded.

Discussion in 'Vuforia' started by yjcnbnbnb200, Dec 12, 2017.

  1. yjcnbnbnb200

    yjcnbnbnb200

    Joined:
    Nov 1, 2017
    Posts:
    25
    I attach this script to empty GameObject, what I want to achieve is different scene can have different World Center Mode, because for now if I didn't use any script to control that, all the scene can only have the same World Center Mode, also in the future I want to have special setting on vuforia configuration for each scene, many thanks for your reply! For now my script doesn't work, the WORLD CENTER MODE keep as before....................

    Code (CSharp):
    1. using UnityEngine;
    2. using Vuforia;
    3. public class MainARControllder : MonoBehaviour
    4. {
    5.     public bool useImageTarget;
    6.     void Start()
    7.     {
    8.         if (useImageTarget)
    9.         {
    10.             VuforiaARController.Instance.SetWorldCenterMode(VuforiaARController.WorldCenterMode.FIRST_TARGET);
    11.         }
    12.         else
    13.         {
    14.             VuforiaARController.Instance.SetWorldCenterMode(VuforiaARController.WorldCenterMode.DEVICE_TRACKING);
    15.         }
    16.     }
    17. }
     
  2. yjcnbnbnb200

    yjcnbnbnb200

    Joined:
    Nov 1, 2017
    Posts:
    25
    I found a post said, vuforia doesn't support switch SetWorldCenterMode at runtime, really?
    And if that is true, which way I can have different World Center Mode for different scene?
     
  3. YHS

    YHS

    Joined:
    Aug 10, 2014
    Posts:
    31
    same question...any one?
     
  4. mende

    mende

    Joined:
    Jun 11, 2013
    Posts:
    29
    Same question again.I want to switch the World Center Mode for using GroundPlane in one scene and in the other Image Target.
     
unityunity