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. Dismiss Notice

Resolved Unity 2022.3.3f1 crash on build, works in playtime

Discussion in 'Editor & General Support' started by dummmmmy, Jul 9, 2023.

  1. dummmmmy

    dummmmmy

    Joined:
    Jun 17, 2023
    Posts:
    12
    one of the scripts that the logs refrence:

    upload_2023-7-10_0-40-29.png
    all of the arrays are counted as an error
    upload_2023-7-10_0-40-55.png
    this is in my custom Class also as an error
    upload_2023-7-10_0-41-27.png
    same as above
    https://pastebin.com/dksMG1i3 - logs
     

    Attached Files:

  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    AnimationController is from the Editor only side of the Unity API. You can't use them in a built project. Normally you can surround them with
    #if UNITY_EDITOR
    pre-processors, though in your case you're going to have to rethink your approach.
     
  3. dummmmmy

    dummmmmy

    Joined:
    Jun 17, 2023
    Posts:
    12
    well thats a bummer because this worked exactly 1 to 1 as i wanted... well, good to know that UnityEditor works in playtime only though
     
  4. dummmmmy

    dummmmmy

    Joined:
    Jun 17, 2023
    Posts:
    12
    changed prefix. i will not mark it as resolved for a while because i lowkey wish for a suggestion on how i can remake it lol
     
  5. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    Shouldn't you just be using the Animator component? It basically does the same thing.
     
  6. dummmmmy

    dummmmmy

    Joined:
    Jun 17, 2023
    Posts:
    12
    hmm, ive replaced every AnimatorController with Animator, and while i still had to use runtimeAnimatorController it didnt pop up the UnityEditor, so i think it should be good. The problem now is that i cannot assign any of the animation controllers in the inspector. which to me is kinda weird. i now fear if its even possible to assign the animators using an array
    upload_2023-7-10_10-47-29.png
     

    Attached Files:

  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    dummmmmy likes this.
  8. dummmmmy

    dummmmmy

    Joined:
    Jun 17, 2023
    Posts:
    12
    I've managed to find the solution, and it turned out to be surprisingly straightforward, just like my initial attempt. Instead of using AnimatorController or Animator, I used RuntimeAnimatorController, which works exactly as AnimatorController but actually works in the build. I would like to help you for your help!
    i will forever remember to not trust the UnityEditor lol
     
  9. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    I wouldn't think of it like that. The API under UnityEditor is for use in the editor, such as editor scripts, editor tools, etc. Naturally it requires the editor to make sense, so it can't be used in build.