Imported PSB prefab origin?

When I import a PSB, the origin of the resultant prefab seems random and not anywhere near the center of the PSB image layers. I’ve double checked each layer in the PSB and there is nothing out away from the layered images in the PSB that would cause this. I would have thought the origin would default to the center of the PSB image width and height.

Is there a way to control the origin location of the prefab that is created from a PSB?

1 Like

Hey,

The default origin, or “pivot,” is set to the bottom of the PSB file:

7506652--925304--Pivot.JPG

You can change this in the PSB’s inspector. You can set it to the center, or choose a custom pivot point. Keep in mind that the custom option is normalized, so it goes from 0 to 1.

1 Like

By this you mean the PSB import inspector? Changes to the pivot there do nothing to my PSB, and after applying a change, when I drag the PSB into a scene the origin remains in the same place relative to the sprite images it contains no matter what I set that to. Is there some other inspector you are talking about?

On closer inspection, the Pivot and the Origin are not at all the same thing. Setting the Pivot does indeed move the pivot, but not the contained sprite layers with respect to the parents origin. The question is, why isn’t the Origin of the PSB transform in the center of its Photoshop PSB file? And, is there any way to move the sprites with respect to the Origin?

Okay, I think I’m very confused now.

Can you define origin? What do you mean when you say “origin” if you’re not talking about the pivot?

If you want to move the sprites inside of the PSB file, you can move them in Photoshop, or add the PSB prefab to the scene and move them there.

When you change the pivot of the PSB file, it will affect the pivot in the scene (where the transform gizmo is positioned). No, there’s no other inspector I’m talking about. It’s possible that you have the pivot toggle set to “center” and not “pivot” and that’s why it’s not changing.

7506878--925325--Center.JPG

7506878--925328--Pivot.JPG

Look at the toggle button named Center/Pivot and try changing that to “Pivot” if it was “Center.”

If you could show some screenshots of your issue, that would be very helpful.

1 Like

Thanks for the help. Sorry Yes, you are correct the origin is the pivot. My brain is dense today! I meant the center. Objects in Unity usually have their default pivot and center in the same place.

This image shows roughly the extents of the PSB. I can center the pivot and it indeed centers within the extents of the PSB. The question is, why does Unity think this is the center of the PSB when I choose to show the Center on the Unity toolbar? I know it doesn’t matter that much, but it makes me think something is off in the PSB.

7506971--925346--upload_2021-9-19_15-51-1.png

Hey,

Thank you for the clarification, I’m much less confused now haha.

So if the image you’re showing is actually the full dimensions of the PSB file, then the pivot is clearly not centered. I have never experienced this behavior before, and you will likely want to double check that your character is actually centered in the PSB file. Remember that Unity takes into account any empty space in the file.

If you link me the PSB file you’re using, I can check if it’s bugged, or perhaps see what’s causing the pivot to be offset.

1 Like

Sorry if I am not on the same page! that’s not the pivot. That is when I choose to show “Center” on the Unity tool bar. The pivot tool and setting works correctly.

That is pretty close to the exact boundaries of the PSB in Photoshop. I’ve measured the exact center, and that is where the pivot apears when I show it. But it was just freaking me out, but then I remembered what you told me is true, and I was way off base about the center of transformation (LOL - my mind wash shifted!)

I’ve gone through each and every layer to see there are some empty pixels hanging out there, but I can’t find any that might cause the Center to be miscalculated when “Center” is selected in the editor scene view! And, it does not do it in another avatar I am rigging the same way.

Anyway, I don’t think it will affect anything! Thanks for setting me straight!

1 Like