Model Not Visible After Updating from 4.3.2 to 4.4.x

Hi,
My implementation works fine in version 4.3.2, but when I update to 4.4.0 or 4.4.1, the model no longer appears on the screen — it seems like the camera is looking elsewhere or moving incorrectly.

For now, I’ve reverted to 4.3.2 to keep things working. I’ve attached the relevant code I’m using. Any help would be appreciated!

I use scenSwitcher. The following script will be called from the child scene (Setting the main camera present in the parent scene)

start(): void {
    if (this.setupCamera) ComponentDataContainer.instance.setBaseCameraPositionV2(this.setupCamera);
  }

The following scripts are present in the parent scene (It takes the camera from the child scene, sets the camera, and stores its value to reset)

setBaseCameraPositionV2(cam: Camera) {
    if (!this.baseCamera) return;
    this.baseCamera.setCameraAndLookTarget(cam);
    setTimeout(() => this.setCameraAndTargetValues(), 1000);
  }

  resetBaseCamera() {
    this.baseCamera?.setLookTargetPosition(this.targetValues);
    this.baseCamera?.setCameraTargetPosition(this.cameraValues);
  }

  setCameraAndTargetValues() {
    this.cameraValues = this.baseCamera?.worldPosition.clone();
    this.targetValues = this.baseCamera?.controls?.target.clone();
  }

Hi Ashok,

The issue you are experiencing—where the model becomes non-visible after updating from version 4.3.2 to 4.4.x—could be related to the way camera settings and scene visibility are handled in the newer version.

Here are a few suggestions to troubleshoot and possibly resolve the problem:

  1. Check Camera Positioning:
    Ensure that your main camera is correctly positioned and looking at your scene. You can log the camera’s position and orientation to verify they are appropriate:

    console.log("Camera Position:", this.baseCamera.worldPosition);
    console.log("Camera Target:", this.baseCamera.controls?.target);
    
  2. Scene Visibility:
    Confirm that no objects are being set to invisible during the scene switch. The update could have changed how visibility is handled, especially if there are changes in instancing or rendering behaviors.

  3. SetTimeout:
    In your setBaseCameraPositionV2 function, the setTimeout is set to 1000 ms. This might not be necessary depending on the update. Try setting the camera position and targets without a delay initially to see if that resolves rendering behaviors:

    setBaseCameraPositionV2(cam: Camera) {
        if (!this.baseCamera) return;
        this.baseCamera.setCameraAndLookTarget(cam);
        this.setCameraAndTargetValues(); // Remove setTimeout
    }
    
  4. Check the Changelog:
    Review the changelog between versions 4.3.x and 4.4.x for any breaking changes that may affect camera behavior or scene rendering. Look for any mention of changes to the OrbitControls or PostprocessingManager that could impact how your camera interacts with the scene. A key change noted includes updates on OrbitControls auto-target behavior (see the documentation).

  5. Debugging Output:
    Utilize debugging outputs or hooks to listen for any changes during the setup of your camera to see if any unexpected behavior is happening as the scene initializes.

  6. Example Reference:
    Check the samples repository for reference implementations that may be using similar setups. It might be beneficial to compare how cameras are set up in those cases. Here’s a link to the Samples Repository.

If after trying these steps the issue persists, please let me know! Providing additional information about your scene setup, such as the configuration of your models and how they are instantiated, could help in further diagnosing the issue.

1 replies left - Get a PRO license for more AI replies.
thread_vxLdDU6TMeUxhJzG99VaWGAI
Reply to this message to continue the conversation

Hello, could you send your project as a bugreport so we can take a look? Thank you

1 Like

Hey, can’t create a bug report. I’m getting this error. Looks like it cant zip those files for some reason. Should I manually zip those files and send it to you?
Creating bug report failed, see C:\Users\KAALO_~1\AppData\Local\Temp\Needle/BugReports/250423-105458/Report/exception_on_collecting_error_logs.oops
Unity.SharpZipLib.Zip.ZipException: size was 0, but I expected 188

Yes, please put a zip on Google Drive or similar if you can – thanks!

Hello, I don’t think we received your files yet? Could you please send them if the issue still persists for you?

Checked it and looks like 4.4.3 update fixed the issue. Thanks!!

1 Like

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.