Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bug PPtr cast failed when dereferencing after moving from 2020.3 to 2021.3

Discussion in 'Editor & General Support' started by mattCap42, Nov 13, 2022.

  1. mattCap42

    mattCap42

    Joined:
    Jul 25, 2022
    Posts:
    7
    I needed to update because my project required Nav Mesh Components. After updating everything works fine in the editor, but every time I try to build and run or publish I get hundreds of PPtr cast failed errors. I have read that this can be from var type mismatch, but I have checked and all of my var types are appropriate. I'm not sure why it is trying to do all of this casting and the errors stack trace doesnt point to any of my scripts so I'm not sure where to begin.

    I have tried removing the Library and relaunching the editor as i saw that worked for someone else, but sadly not for me. I tried removing and reinstalling TMP as a lot of the build errors had a stack trace leading to a TMP perBuildProcessing script. no joy there either

    so now I either import my backup package into 2020.3 again and can't use Nav Mesh Components or keep it in 2021.3 and can't build or publish. Neither of these will work :(


    Screenshot 2022-11-13 171528.png
     
  2. mattCap42

    mattCap42

    Joined:
    Jul 25, 2022
    Posts:
    7
    To make matters worse, If I cant fix the 2021 build i will have lost a full day of work, and my project is in October Showcase, and i don't think I can publish it anymore as a new project won't have the same ID :(


    AND .. i just opened my backup project package in 2020 and it has all the PPtr errors as well. please help my project is Borked!
     
  3. mattCap42

    mattCap42

    Joined:
    Jul 25, 2022
    Posts:
    7
    It seems the source of this problem was creating a scene from a scene template and then upgrading editor version. It seems the prefab .fbx files copied into the new scene were causing all of the errors.

    after deleting them the game runs and can be built