Hello,
I have a question. I can turn my head in the Oculus Quest 2 and i can look around the city. I can also Continous move over the Basemap with the dumpstick of the controller but now i trying to make a teleport area on the basemap or the roads layer so that i can jump to locations ((continous move is slow:)). I have set a teleport provider on the XR Origin and often you can add the teleport area component at a gameobject that has a collider with the result you can jump on it. But the Basemap and Road layer are game objects?
Can someone help me with this?
Solved! Go to Solution.
There is a Script called "SceneComponentProvider" in the ArcGisMapsSDK for Unity Package.
(would be nice to attach the script directly here, but i didnt get it to work)
Script for attaching(super dirty:-)):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class findobject : MonoBehaviour
{
GameObject[] myobject;
int arraylength;
void Update()
{
myobject = GameObject.FindGameObjectsWithTag("ArcGis");
if (myobject.Length != arraylength)
{
for (int i = 0; i < myobject.Length; i++)
{
if (myobject[i].GetComponent<TeleportationArea>() == null) { myobject[i].AddComponent<TeleportationArea>(); }
}
}
arraylength = myobject.Length;
}
}
One approach that works is to create some non-Esri game objects in your scene and set those up as teleport areas. This is the approach I have taken.
I have not tried to create teleport areas directly on Esri objects. Perhaps others in the community will share their attempts/experiences with this.
-Cory
He, Thanks for your answer. My solution was also to increase the Continous movement distance in seconds. I can walk faster now.
I hope ESRI find a way to give the possibility to put teleport areas on raster of vector layers.
There is not out of the box way to do that yet. You can mock a teleportation by casting a ray from the controller and getting the point it hits the basemap. (same as what we are doing in the ArcGIS Raycast sample) but instead move the camera to that point
Had the same issue, i tagged all the ArcgisGameObjects, search for the tagged objects in update and attached the Telepot Area Script to each one.
Hello,
What do you mean with Tagged? The layer tiles load everytime again when you look to it in the headset. And then it also gets another game object number and lost the Teleport Area script.
There is a Script called "SceneComponentProvider" in the ArcGisMapsSDK for Unity Package.
(would be nice to attach the script directly here, but i didnt get it to work)
Script for attaching(super dirty:-)):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class findobject : MonoBehaviour
{
GameObject[] myobject;
int arraylength;
void Update()
{
myobject = GameObject.FindGameObjectsWithTag("ArcGis");
if (myobject.Length != arraylength)
{
for (int i = 0; i < myobject.Length; i++)
{
if (myobject[i].GetComponent<TeleportationArea>() == null) { myobject[i].AddComponent<TeleportationArea>(); }
}
}
arraylength = myobject.Length;
}
}
Where (on which gameobject?)do i place the scène component provider script to tag all gameobjects with ArcGiS. And where the attaching script to attach the teleport component to the ArcGIS tagged gameobjects?
Thanks for the solution and code. It works, though agreed--is pretty dirty. Still.
With the new v1.1.0 SDK, the file to modify seems to now be Esri.ArcGISMapsSDK.Renderer.Renderables.RenderableProvider.
You just need to insert the line of code(red Arrow in the Picture above) in the SceneComponentProvider Script this will tag all ArcGis Gameobjects with the Tag"ArcGis". Then you need to add this Tag in the Unity Editor.
the "findobject" Script from above just put it on an empty gameobject in the scene.