Search code examples
unity-game-engineunityscript

Calculate random value * unknown value = 1


I'm having trouble importing the models from maya fbx to unity at the right scale. I detected the problem being inside Unity when importing the fbx file.

There's not really a workaround this other than changing by hand the .meta file:

useFileScale: 0

Since modelImporter.isFileScaleUsed in Unity is read-only, I can't change the value with a script, but I can change the global scale:

globalScale

Say I have file scale at 0.01, the normal value is 1 for scale, how can I calculate 0.01 * 100 = 1 with UnityScript, meaning I need to get the value 100 out of equation 0.01 * ? = 1?


Solution

  • Divide 1 by the value you know. For example, if a * b = 1 then 1/a = b.