Search Unity

Can't apply changes to psb prefab

Discussion in '2D' started by argens, Sep 9, 2019.

  1. argens

    argens

    Joined:
    Jun 21, 2018
    Posts:
    26
    Hello all,

    have the following problem. I am doing the Brackeys tutorial on skeletal animation. i do not own photoshop.
    I have found a psb file to which I have attached all the bones, etc. I also added a rigidbody2D and box collider, but when I try to apply all the changes, unity prevents me from doing this. It is like at the attached picture.
    Can anyone help me to solve the problem?

    Thanks in advance!
     
  2. argens

    argens

    Joined:
    Jun 21, 2018
    Posts:
    26
    Anyone?
     
  3. coslor

    coslor

    Joined:
    Jun 19, 2017
    Posts:
    3
    I'm no expert on this topic by any means, but I did have a couple of thoughts:
    • It looks like what you have there is a model prefab. There is more discussion of model prefabs (in a slightly different context) here. You should just be able to drag the model prefab into a scene, to create a true (editable) prefab out of it.
    • I feel your pain on trying to create a PSB file without Photoshop, but I ran across this trick: you can create a graphics file with the appropriate layers in Gimp (a free graphics program), and export it as a PSD file. Unfortunately, the Unity importer doesn't know what to do with PSD files. Fortunately, the two formats are similar enough that you can simply export your file from Gimp as a PSD, and then, outside of Gimp, rename the file as a PSB file. The Unity importer will then happily read it, and let you use it for bone-based animation going forward. The only hitch I've found is that Gimp doesn't seem to write the level numbers correctly in the internal file format, as the importer seems to grumble about this a little. It doesn't seem to affect functionality, though.
     
    petrknedlik3 and argens like this.
  4. argens

    argens

    Joined:
    Jun 21, 2018
    Posts:
    26
    Thanks for the help.

    The trick with the PSD to PSB was already known to me (and thats how I got the model to work ;-)).

    About the model prefab I found a way around (and also thanks for the link, it was helpful). I just unpack the model and, if necessary, then I do a new prefab out of it, like at the attached picture. Anyway, your answer motivated me to move on and try harder! Thanks a lot! :)
     

    Attached Files:

    petrknedlik3 likes this.
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    This is by design as reimporting your file will override any changes done to the prefab. Instead of using the prefab directly, you can right-click the asset and use Create/Prefab Variant to create a variant of this prefab. You can then use this variant and make changes such as adding colliders to it now. When you reimport the original PSD/B file due to changes, the variant should pick up those changes as well while keeping you own changes (such as colliders) as long as there are no drastic changes.
     
    argens likes this.
  6. argens

    argens

    Joined:
    Jun 21, 2018
    Posts:
    26

    Thanks for the hint! The trick with the variant really does the job.