0
\$\begingroup\$

what my problem is:

I imported FBX models, when I click those objects from Project tab, I see the values of Transform are different and can't be changed (The Transform values under Imported Object section in the Inspector tab). These Transform values belong to the FBX object instead of a GameObject from the Hierarchy. And it seems it is predefined and I could not find a way to change them.

Here is how it looks:

Imported Object section in the Inspector when clicked the .fbx file

How it should look like:

enter image description here

Why is it a problem:

Because I spawn (Instantiate) their prefabs during gameplay but even though the values of the Transform (position) in their prefab is 0 and even the code is correct, those 2 objects spawn to different locations because of this predefined Transform values. (And even though their GameObjects' Transform is correct after spawning)

Why it occurs:

I did not create the FBX models so I do not know how they exported. (I'm trying to work for a studio and they wanted me to create a mini prototype game.) After models sended to me, I put them to the Assets folder of Unity. I also tried to import them from the Import new Asset... settings from the Assets tab but it also did not solve the issue. So I don't know how to change those settings.

Other things I tried to solve the issue:

I imported the FBX files to Blender, thinking that if I re-export them maybe the transform values look right when I reimport them to Unity. And it did but all the materials gone when I imported them to Blender and I can't access or find materials either in Blender or Unity. So I contacted the person who sent me the models and told them to change the transform values from the program which the models created, and then export them as FBX and send me. But they said I need to look the import settings in Unity again. No import settings occur when I import them. And the import settings of the Transform can't be changed.

So I have no clue how to change the Transform values of the Imported Object (making the position zero of that Transform)

I also tried to change those values from script but looks like it is not possible. Any help is appreciated.

Much thanks <3

P.S.

The local pivot of the prefab of the object (the first screenshot in this question) which has the wrong transform values in fbx: (Object name is V11):

And below is from the other object, local pivot of the prefab of the object (the second screenshot in this question) which has the correct transform values in fbx: (Object name is V12):

\$\endgroup\$
3
  • \$\begingroup\$ I think the symptoms you're describing (after spawning, transform values look correct but objects are misaligned) are due to a different issue than the objects' placement within their model file. You're already overriding that anyway when you're placing your spawned copy. I think your real issue is that the pivot point for these objects - the (0, 0, 0) point in their local coordinate system - is not where you expect it to be relative to their visible geometry. Can you show us an example, with the scene transform gizmo in Local Pivot mode, so we can see what we need to correct for? \$\endgroup\$
    – DMGregory
    Jan 15, 2023 at 14:41
  • \$\begingroup\$ @DMGregory Thank you, here I took screenshot of them and edited my question with the screenshots :) \$\endgroup\$
    – sdo
    Jan 18, 2023 at 12:14
  • \$\begingroup\$ It looks like the "correct" model has its pivot at the bottom-center, while the problematic example has its pivot in the middle of the object vertically, is that accurate? So when placing these two buildings on the same ground plane / assigning them the same y value, the correct building sits on the ground while the incorrect one sinks halfway into the ground? \$\endgroup\$
    – DMGregory
    Jan 18, 2023 at 13:16

2 Answers 2

2
\$\begingroup\$

I tried to find the Freeze Transforms option but could not find it. I imported the fbx objects to Blender and just re-exported them. It looks like the transform values corrected but all the materials gone just after importing them to Blender. So all models look they do not have materials.

And I realized that I can extract the embedded materials of the old models (the ones which have wrong transform values) so I extracted those materials in unity (expand the fbx model and right click the material (you can select all the materials with shift click and then right click)) and placed those materials to the new models which have correct transform values. And that's how I solved the problem. I hope it helps for someone who is having the same issue.

Expanding the fbx model (in Unity, under project tab):

enter image description here

\$\endgroup\$
0
\$\begingroup\$

I believe you have to open it in a 3D modelling software (such as Blender or Maya), and do action "Freeze Transforms"

\$\endgroup\$
2
  • \$\begingroup\$ I could not do the Freeze Transform action. I imported the fbx objects to blender and just re-exported them. It looks like the transform values corrected but all the materials gone just after importing them to Blender :( \$\endgroup\$
    – sdo
    Jan 18, 2023 at 12:17
  • \$\begingroup\$ Yes I have had this problem too when just grabbing stuff from websites I find online. I think you can fix that by re-assigning all the materials but yeah I ended up just learning to make my own models (sadly they are nowhere near as good as lots of the stuff we find online though) :( I have even had models I create MYSELF in Maya and then months later I need to reimport it to Maya and some of the materials are all green, I have to redo it. It can be frustrating \$\endgroup\$ Jan 18, 2023 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .