Jump to content

Scaling parts in Unity?


Recommended Posts

I've build a part for KSP but I got the scale a bit off - I want my part to be 1.25m big but I made it 1m instead, and also the rotation is off by 90 degrees. When I try to fix this in Unity by tweaking the object's details in the transform menu (I change the scale to 1.25m on X, Y, and Z, and I've rotated it by 90 degrees too), the changes don't seem to apply when I try it in-game. Do I need to fix this in Blender or can Unity do it but I'm doing something wrong?

Link to comment
Share on other sites

You can do it in Blender, OR you can do it in Unity, OR you can rescale it in a .cfg, using a rescaleFactor = definition.... I would do it all in Unity, tho, personally...

I think you need to make sure you are making the changes Globally, and not Local, tho.. ??

Link to comment
Share on other sites

5 hours ago, Stone Blue said:

You can do it in Blender, OR you can do it in Unity, OR you can rescale it in a .cfg, using a rescaleFactor = definition.... I would do it all in Unity, tho, personally...

I think you need to make sure you are making the changes Globally, and not Local, tho.. ??

Sage advice here @Stone Blue. On the parts I've been working with I go a rather long winded approach where the model is made in AutoCAD and then exported to Blander as an FBX. I use Blender to resize to close the KSP sizes for Unity units (approximately 1 unit Blender diameter cylinder is = to 1.25m diameter KSp part in unity) normally by scaling by .1 (make it on tenth its size) or sometimes by .75 (three quarters size).

However I had to adjust things again in unity to fine tune and to remove any sort of reScaleFactor in the config file (a must if you plan on using an IVA).

In Unity, when adjusting the size you want the parent GameObject which you'll be 'writing' (using the Part Tools script) to be scaled in the X, Y and Z otherwise it won't appear to have been scaled when it's loaded in-game. As a side effect from this I have seen than any other parts/model/meshes you child to that parent GameObject will be similarly scaled automatically.

TLDR: Don't scale the model mesh of your part in Unity, scale the whole transform.

(P.S. there could be a more efficient way of doing this but it's how I have achieved it through much trial and error.)

Link to comment
Share on other sites

9 hours ago, Van Disaster said:

I would fix it at source, tbh - the less Unity has to do the better, plus if you ever reparent it you won't have to mess with transforms again.

I dont know about other 3d programs, but Blender tends to cause beginners issues with scaling when importing into Unity... I havent had any issues with rotations, tho, so THAT shouldnt be a problem in Blender, OTHER than Blender axis are oriented differently than KSP... Again, Unity axis are the same as KSP, so might be easier to figure out at first...

But yes, generally, I also think fixing things at the source is best... :)

3 hours ago, steedcrugeon said:

In Unity, when adjusting the size you want the parent GameObject which you'll be 'writing' (using the Part Tools script) to be scaled in the X, Y and Z otherwise it won't appear to have been scaled when it's loaded in-game. As a side effect from this I have seen than any other parts/model/meshes you child to that parent GameObject will be similarly scaled automatically.

TLDR: Don't scale the model mesh of your part in Unity, scale the whole transform.

Yup... I forgot to mention that part... If you scale anything under the parent GameObject, things can get tricky... Same with the X/Y/Z orientations

Edited by Stone Blue
Link to comment
Share on other sites

2 hours ago, Stone Blue said:

I dont know about other 3d programs, but Blender tends to cause beginners issues with scaling when importing into Unity... I havent had any issues with rotations, tho, so THAT shouldnt be a problem in Blender, OTHER than Blender axis are oriented differently than KSP... Again, Unity axis are the same as KSP, so might be easier to figure out at first...

There's a lot of things wrong with Max, but the import workflow is not one of them... but I think the OP's issue was he just didn't make the model itself the right size rather than "when I put this in Unity it was totally wrong". I'd definitely recommend fixing that in Blender first ( not least to get used to making things the right size! ). Then the import scale factor is just 1 :P this wierd business of Blender having the wrong size units sounds a little crazy.

Edited by Van Disaster
Link to comment
Share on other sites

11 hours ago, steedcrugeon said:

Sage advice here @Stone Blue. On the parts I've been working with I go a rather long winded approach where the model is made in AutoCAD and then exported to Blander as an FBX. I use Blender to resize to close the KSP sizes for Unity units (approximately 1 unit Blender diameter cylinder is = to 1.25m diameter KSp part in unity) normally by scaling by .1 (make it on tenth its size) or sometimes by .75 (three quarters size).

However I had to adjust things again in unity to fine tune and to remove any sort of reScaleFactor in the config file (a must if you plan on using an IVA)

If you want to scale a model within the cfg, you would not want to use reScaleFactor in any way. You just use scale within the model node like:

 

    MODEL
    {
        model = HGA/Proton/parts/proton_launchpad
        scale = 0.60976,0.60976,0.60976
    }
    rescaleFactor = 1.0
    scale = 1.0

works perfectly. Combine this with proper attachment node definitions using using the node-tag and a empty transform like

	NODE
	{
		name = top
		transform = launchpad_nodetop
		size = 3
		method = FIXED_JOINT
	}

instead of wiggling around with written out coordinates and you set yourself up a perfect re-scalability without any hassling while having perfect nodes without any rounding issues.

Also, use metrics in blender, then a meter in blender is a meter in ksp no matter what, no need to wrestle around with arbitrary "unit" measures. I use this to model anything in a real 1:1 original scale and then down-scaling it within the model node of the cfg file for stock (0.60976 scale) or realism overhaul (1.0 scale)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...