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

Question Editor scripts: Make prefab from .fbx

Discussion in 'Scripting' started by denmla1001, Jun 15, 2023.

  1. denmla1001

    denmla1001

    Joined:
    Nov 29, 2021
    Posts:
    11
    I have a need to do all of this via editor scripts:
    • Create prefab from .fbx file
    • Attach a script to that prefab
    • Fill that script public values with references to meshes from the fbx based on names
    • Mark that prefab as Addressable and set it's addressable label
    • Build and upload new addressable files to CDN
    Do you know if I can do any of this things via editor scripts (buttons on some components for example)?
    I will be better to do all of this in runtime but I think it is impossible so my next target are editor scripts
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Yep.

    Hint 1: all five things won't happen at the same time. You will engineer one at a time.

    Hint 2: all five things above have plenty of online docs and tutorials to start with.

    If you encounter an issue, here is how to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, log output, variable values, and especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/
     
  3. denmla1001

    denmla1001

    Joined:
    Nov 29, 2021
    Posts:
    11
    Tnx
    I would argue about that plenty documents but I am cracking now one by one and I will see where will that get me :)