Jump to content

Unity to KSP: A Detailed Tutorial


Recommended Posts

though the tutorial is somewhat unclear as to what folder the textures themselves should be in (the root part folder, or the materials folder

If you mean in the unity asset library then it doesn't matter in the least. If you're talking about the part folder in the KSP/Parts/ directory then the textures should be in the root of your part's folder, not in a textures or materials subfolder.

. nevertheless, I have applied the texture to the model in the hierarchy, but when i click "write" in the part tools, it completes instantaneously and creates the parts folder in the project directory. however, there is only the model.mu file and nothing else. Any ideas? I can post a screen cap if you wish (just tell me what you want to be selected).

Is there any error message in the Unity console?

also, what should I do to my node_collide object?

Delete it, that's for the old system where KSP would import a dae file itself instead of you using the part tools to make a model.mu file.

The normal method now is either to add box/sphere/capsule colliders to your model object(s) (or otherwise blank GameObjects created in unity if you need more colliders) or add a mesh collider to the object with your visible mesh on which will wrap itself around the visible mesh automatically, if the simpler and better performing colliders won't make the right shape. Be sure to tick the convex box or it won't collide properly.

Link to comment
Share on other sites

Has i try adding PartTools on the empty object, its not working because of this.

I also get a message telling me the compilation is not done . :(

Internal compiler error. See the console log for more information. output was:error CS0006: cannot find metadata file `C:/Users/Me/Desktop/Programs'

error CS0006: cannot find metadata file ` No security clearence/Unity/Editor/Data/Managed/UnityEngine.dll'

error CS0006: cannot find metadata file `C:/Users/Me/Desktop/Programs'

error CS0006: cannot find metadata file ` No security clearence/Unity/Editor/Data/Managed/UnityEditor.dll'

Also could i get a fast tutorial on how to add an airlock script and ladder. Finally can i have multiple entrances ( Airlocks) for one part? i have seen this tutorial but its not helping has im a noob with Unity.

http://wiki.kerbalspaceprogram.com/wiki/Adding_Airlocks_and_Ladders_to_Parts

Thanks for the help !

Edited by Jakey4159
Link to comment
Share on other sites

  • 2 weeks later...

I have a quick question about Unity and Custom Engine Fairings with "ModuleJettison", just like the Standard-Engines handle it.

My Fairing is invisible in-Game if not in use, 'cause I turned off "MeshRenderer" in Unity, but is still visible in

the small Part-Preview in VAB...

What do I have to do in order to make it invisible in the preview too?

Link to comment
Share on other sites

Hm, it doesn't work! I did everything you said, but after the step with the New Folder, there are no materials or textures. It's empty. Please help me!

If drag and drop doesn't work you can right click in there and pick import new asset

Link to comment
Share on other sites

  • 3 weeks later...
can you make a tutorial for the PartTools for 0.20

I second that, I can just about second guess when following these instructions but I get stuck when Exporting to KSP

Link to comment
Share on other sites

  • 2 weeks later...

Awesome tutorial!

But could you update the bit about PartTools. The files in part tools look differnt from what you have pictured. I have tried all the 'PartTool.dll' there as per your instructions, but when i get to the end i cant get parttool info in the rightside window.

Also quick question:

I have been learning blender and unity (or trying to i should say) kinda at the same time. Most of the tutorial info i can find is really outdated. As a result part of Blender model making includes adding meshes inside the model and naming them 'node_collider'. Does this still need to be done if said model is imported into Unity?

Also, this thread should be sticked in place of the one thats for KSP 0.18. This info is way more up to date.

Edited by KhaosCorp
Link to comment
Share on other sites

Man, this is not completely right (the tutorial).

If i do as you said, it will export empty, nothing.

The object, or objects need to be part of the Part Tools, not in the same hierarchy. All must be connected to work. And even in that way, i couldn't make two lights on off (together with texture selfilum) work correctly. I can make the interact lights turn on and off, but the buttons for that keeping disappearing in the contest menu on KSP.

Link to comment
Share on other sites

I have tried all the 'PartTool.dll' there as per your instructions, but when i get to the end i cant get parttool info in the rightside window.

If you are having trouble installing the 0.20 part tools, clear absolutely everything you can find inside your Unity install that has anything to do with plugins or part tools. Then re-open Unity and go Assets -> Import Package -> Custom Package... and then select the 0.20 Part tools from wherever you downloaded them to. That is what worked for me.

As a result part of Blender model making includes adding meshes inside the model and naming them 'node_collider'. Does this still need to be done if said model is imported into Unity?

No, you don't need to add an invisible mesh inside the model anymore. You can simply choose to set a physics mesh to the object like the tutorial states. Use box colliders whenever possible, though with many things in KSP being cylindrical, you may have to use a mesh collider instead. You can simply tick "Convex" which will give you one based on your model (like this), but simpler colliders are always better. You can select whatever mesh you like in the Inspector window for the mesh collider. You can make a custom collider mesh in Blender and export that over into Unity to use. Bear in mind that mesh does not have to be anywhere in your parts hierarchy, simply select it in the mesh collider options. Remember to make sure it is convex though!

Man, this is not completely right (the tutorial).

If i do as you said, it will export empty, nothing.

The object, or objects need to be part of the Part Tools, not in the same hierarchy. All must be connected to work. And even in that way, i couldn't make two lights on off (together with texture selfilum) work correctly. I can make the interact lights turn on and off, but the buttons for that keeping disappearing in the contest menu on KSP.

What I do is create an empty GameObject that is the parent of everything else in my part, then I add the part tools to that. I've yet to run into a problem with doing this.

Link to comment
Share on other sites

Part Tools crash course:

1) Tools > KSP Part Tools > setup, set this to your GameData folder*

2) GameObject > Create empty object, rename to Part Tools

2) with the object selected, click add component on the right, add KSP > Part Tools

3) set the file url to the folder for the part. You have already set up the game directory under Tools>KSP Part Tools, so this URL should be "modname\Parts\partname"

4) build your part entirely within this object (drag your part from the asset window onto Part Tools)

5) when you select your Part Tools object and you press "write" on the script component, the folders, model, and texture file should be created.

*If you are getting an error when you go to Tools>KSP Part Tools and cannot see anything in the window, delete Chatterer from your KSP GameData folder (other mods may cause this problem but this is what fixed it for me).

edit: when you delete a mod like chatterer, back up your save files in case you lose ships you forgot the part was attached to. To keep my station functional I deleted the plugins from the mod and deleted the module reference in the chatterer part cfgs; not sure that part was even needed though.

Edited by Nazari1382
Link to comment
Share on other sites

I can get parts into KSP from Unity now, even facing the right direction in VAB!!!

Couple things I am still getting hung up on.

First and foremost is node placement. I understand the config part of it, but not how to get starting messurements for node placement. There was an old tutorial I saw detailing how to do this in Blender, selecting the face you want node on and making note of global median, then convert those to KSP. But once the model is Imorted into unity those messurements from blender are useless. Is there an easy way to select a single face of modle and get global median in Unity Im overlooking?

Second issue is with the parts once I get them into KSP. Even when using oversized nodes the connections between my parts and stock parts seems very flimsy. The test adapter plate I made was actually pressed though a fuel tank by engines. Nothing broke, but it was not right at all. Is this a result from using mesh collider?

Link to comment
Share on other sites

you can use the new method by placing game objects in unity, check out this post:

http://forum.kerbalspaceprogram.com/showthread.php/34013-0-20-PartTools-GameDatabase-and-new-features?p=445657&viewfull=1#post445657

or you can place an empty object where you want the attachment node, and note it's position in unity. Use those values for the config.

Link to comment
Share on other sites

or you can place an empty object where you want the attachment node, and note it's position in unity. Use those values for the config.

well thats nice and simple! Why cant all Blender/Unity answers be like this?!?

Thanks again bud =)

Edit:

Whats the best type of collider to use for areas where Kerbals will be walkin around? Im guessin box, but am actually clueless.

Also, is it possible to have attach node follow an animation without using a plugin?

Edited by KhaosCorp
new question
Link to comment
Share on other sites

  • 4 weeks later...

I have tryed this tut and all I get is a model.mu thats 1 kb in size! And when I try to put it into the game it's invisible!

To me it looks like Unity is not using the model I put in, But just making a blank .mu file. Not sure why!

Link to comment
Share on other sites

  • 2 weeks later...

it is possible to import a .mu file in unity without a custom importer.

it wont have functionality but you can import them.

im not sure if squad likes me to explain how to do this.

so i won't, untill they tell me otherwise.

Link to comment
Share on other sites

  • 2 weeks later...

Hi again. I'm using Unity v. 4.2.1f4 (current version). I'm also using the current (KSP) PartTools v. 0.20. Having followed the tutorial as closely as I can, I have encountered a problem. But first, I solved a minor issue. Using a Mac, the zip file will tend to be unzipped in the Downloads folder (or wherever you have it set up). Simply take the unzipped folder and put it into the Unity folder. Next, take the applicable package (partTools or upgrade unity package) and move or copy it from there to the Unity Standard Packages folder. I used the partTools package since I've not used earlier version(s). Then that package was imported as per the tutorial.

One concern (part of the problem) is that when I try to drop the PartTools folder from Assets into/ onto the empty game object (I call it PartToolsObject), the PartTools folder will not go in. I've tried placing the subfolders into it but they won't go in. I've tried placing all of those folders into just the hierarchy space and they won't go in. And yes, first I had given the game object the same name; PartTools.

I am able to get my model and texture into Unity and see them with no problems (expected) and I'm able to set up KSP material/ texture rendering settings from within the Unity Inspector.

When I go to export, following the instructions, selecting the gameObject does nothing; shows me no menu (no surprise). When I go to Tools/ KSP Part Tools at the top menu bar, I get a message: "No internal configs found". When I try to select any of the Part Tools folders, these will not work. No file within them is selectable.

Any help on this would be appreciated. Thanks in advance!

Edited by Dispatcher
Added title.
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...