It was attached to XR origin originally, I just changed it to this object and still same problem. About where the UI stops working I get this error message. And yes, sometimes terrain falls down or flies away, but that goes away after 2-3 builds.
I’ve never seen that error before. I see you’re using Interaction Toolkit 2.4.0. I’m currently using 2.3.2. I can try to upgrade.
I will try to do a brand new project, I’ve been using this project for a while making copies, I wonder if something got corrupted in the process.
Can that be that when I made a copy of the project I got a warning “file is too long for the destination folder?” I ignore that since it never affected anything, I thought it is just some file I have there from my assets.
I don’t think that would affect anything. I rename my project to a single letter to avoid that issue (it does mess up when building the native code).
That long filename in the error message that starts with e66f in the front looks familiar, like something came up in the warning window when I made a copy.
it does seem like the long file path could be the issue.
First, you were right, the Cesium Origin script should be attached to the XR Origin object.
Second, I installed 2.4.0 as well as the latest Unity 2022, and I have trouble teleporting around. Its teleporting me to a different location than I pointed. My best bet is to try switching to 2021.3 and 2.3.2 to see if that fixes the issue.
You are teleporting backwards because your head wasn’t turned together with the body, you probably used the mouse to rotate and turned yourself backwards with your body behind you. You need to switch between head and hands using the tab, and make sure to rotate only with your head, not the mouse.
The good news is that I got it working using a brand new project. The bad news is I still don’t know what caused the current project to corrupt. I just tried making a project copy to the root D drive and there were no warnings about the path being too long. So, maybe you can communicate with Unity for them to make all their files short enough for us to make copies and not to corrupt the files? I also will set up a meeting with my IT guy to remove Window’s restrictions on the length of the path. Its frustrating cause there is a lot of work involved to move everything to the new project. And Unity has no problem making UI work with their native terrain, no matter how far I travel.
Evgeniya
Awesome! I think we can be confident that the problem was caused by long file path.
I just found out what the problem is, and it is nothing we discussed above. The problem is in the teleportation area script. When I started moving my assets, I run into the same problem, so I deleted everything and started moving everything one by one. The UI was working perfectly no matter how far I went, and when I brough it the teleportation script, the same problem happened again when I moved to a certain distance. Do you think you can fix that?
using CesiumForUnity;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class AttachTeleportationArea : MonoBehaviour
{
// You can drag-and-drop the desired tileset into this variable in the Inspector.
// But for demonstration’s sake, this will assume that the script is attached to
// a game object with a Cesium3DTileset
component.
public Cesium3DTileset tileset;
void Awake()
{
if (tileset != null)
{
tileset.OnTileGameObjectCreated += go => go.AddComponent<TeleportationArea>();
}
}
}
So, I’ve been using the teleportation script without issues. Except the one I use is here:
cesium-unity-samples/Assets/CesiumForUnitySamples/Scripts/CesiumSamplesTeleportationArea.cs at main · CesiumGS/cesium-unity-samples (github.com)
The difference is that it is called on Start instead of Awake, and also that it needs to be attached to the 3d tileset GameObject.
Did all that, same problem
For now, I will put a bunch of invisible planes on top of the terrain, and remove the script entirely. Hope that can be fixed at some point.
Checked back and it appears the issue has been resolved. I got this scrips and dropped it on the tileset. UI works fine when I go far.
using UnityEngine;
using CesiumForUnity;
using UnityEngine.XR.Interaction.Toolkit;
public class CesiumSamplesTeleportationArea : MonoBehaviour
{
void Start()
{
Cesium3DTileset tileset = GetComponent();
if (tileset != null)
{
tileset.OnTileGameObjectCreated += go =>
go.AddComponent();
}
}
}
Unfortunately, I was celebrating too early. The same issue persisting for me. My screen still stops working once I walk away from the origin point.
Doing more tests, added a large custom plateau on top of the Cesium terrain, and removed the teleportation script provided by Cesium. Only added “teleportation area” script that came with XR interaction toolkit. But same issue occurred. Tested it AGAIN with regular Unity terrain, and there are no problems.
Patiently waiting for this to be fixed, I have a group of 30 alpha testers testing the app currently, and I have to remind them not to do more than 25 teleportations, otherwise UI will shut down. I can’t be the only one who runs into this problem.
Can anything be done ASAP please? @patrick @Shehzan_Mohammed @Kevin_Ring
We can’t fix this (ASAP or otherwise) because we can’t reproduce it and don’t know what is causing it for you. Help us reproduce the problem by providing detailed step-by-step instructions, preferably starting with the Cesium for Unity Samples project, and we can take a look!
Yes, I’d be happy to. But I prefer to use Unity 2022.3.4lts for the step by step instructions, because that’s what I use. I also packaged the project and you can see it for yourself, with two scenes - regular Unity terrain and Cesium.
- Start a new project, and select VR Core as a template. (Unity 2022.3.4 lts)
- Go to File - Build Settings - Switch platform to Android.
- Edit - Project Settings - Scroll down and select XR Plugin Management and change platform to Oculus (both in Android Tab and Windows)
- Go to Window - Package Manager - Scroll down to XR Interaction toolkit, and import XR device simulator package under Samples tab.
- Install Cesium via scooped registry, as per instructions on your website.
- Open the sample scene provided by Unity.
- Drop XR device simulator into the hierarchy, so you can test it on the desktop.
- Test it by pressing play, you can move around and switch hands by pressing tab. The main one at this time would be to use right hand and press W to teleport.
- Make a copy of this scene and add Cesium in that new scene, test it again and use Tab to go to the right hand, and press W to teleport. At about 20 teleportations, you will get a thousand errors that I indicated above. And this is when UI shuts down in the game. In VR W = primary2Daxis (right hand joystick).
Here is drive with the entire project. Thanks!
Evgeniya