Jump to content

Only a fraction of my custom part loads into KSP


Recommended Posts

Solved, don't let your meshes have more than one material assigned to them

tl;dr - the second last picture is my part, the last picture is what it looks like loaded into Kerbal

So I've tried as hard as I can at doing this before writing this asking for help. I have used all the stickied posts on the forum, t

, and this thread. Now everything except the video is using the old part tools, not the .23 one so maybe I set that up wrong, but I don't think so, I get it to load into the gameobject just fine. But I'll cover that in more detail later.

In this post I will cover in detail every step from blender to ksp. You have to understand that I have never used blender or unity before, and I'm trying to learn this all from scratch. There might be some basic things I'm missing, but based on the directions I have been following I believe it's all done correctly. I'm pretty proud I've made it this far.

Just for some background. My plan is to release fully functional Zoid mechs created by artists on DeviantArt. People have created these things already for the sake of art, and I want to put them in the game and have me and a couple other users make them walk/fly/blow **** up. The one I am working on here was created by DeviantArt user DGMM. He has a bunch of these and if I get this one to work I believe I could convince him to send me his others. His gallery is here.

This is the forum post for my project. There's more pictures there.

Here you can see I've loaded the thing into the game as a whole as a proof of concept. Later you will see that my part isn't loading completely. It's reasonable to believe the part is too detailed for the game, but then why does it load as a whole?

ZcmGuaG.png

My plan is to eventually animate these parts so that they move by themselves, but animation is probably gonna take me a while to learn. So my first plan is to attach the parts using existing Infernal Robotics parts. For both plans I need to break the whole model up into parts. I'm thinking head, neck, body, tail, legs and arms(which will also have to be broken up at the joints).

So as you can see here, in blender I isolated the part that I wanted, grouped all the parts together, moved the origin to the COM, and centered the whole thing. I also deleted a lot of the cosmetic, super detailed parts. Then I saved it as a .blend file

YWV9os2.png

Then I set up unity just as the instructions in the video said. I created a new project and put my .blend file and part tools folder into assets.(Maybe PartTools isn't supposed to go in Assets? Thats the only place I get them to load into unity though) I created an empty gameobject, set all the positions to 0, and added "part tools" via the "add component".

Then before dragging the body file over to gameobject, I set all the materials to KSP/Emissive/Diffuse, turned off all the animation settings for the part, and toggled "Generate Colliders" and "Generate lightmap". I toggled those two after one of the forum posts I found told me to, but I also tried writing the part without those toggled. I also tried writing the part without any of the animations turned off.

Then I dragged the part into game object and added a "Mesh Collider" to the body part. In the mesh collider i toggled Convex as well. In this example I'm not adding textures yet, but I have tried writing the part with them.

Then in the part tools component I changed the Model name to "model" and the texture format to "TGA Uncompressed" as thats what the gentleman in the video used. I have however, tried every format now, to the same result.

0Ds7ezm.png

pGrr5bU.png

Then I click the write button and my .mu shows up in the gamedata folder I created in my Unity project folder. I dragged that into my folder for the part in KSP and wrote a .cfg. I just copied a fuel tanks .cfg and changed the name. That's why the attachment points aren't correct in the picture. I haven't figured those out yet, but I'll cross that bridge when I get there.

Now I load up the game and every single time, no matter how many different settings I try, this is how it looks.

bnV2rcy.png

Like I said, it might be because the part is too detailed, but then why did it load into the game as a whole? Also, and I can't find any other example of this on the internet. When I write my model in my finder it is classified as a "Document" where as every other stock mu in KSP is classified as an "Unix Executable File". Maybe thats something.

I'm really just stuck and I would greatly appreciate any suggestions you might have, as I really want to accomplish this. Any suggestions at all, I'd be happy to credit you when I release the thing. And even better, if you'd like to be part of the project I'd be happy to have you, especially for the textures and animations.

Please feel free to ask any questions as well. There might have been some things I missed in this description, but I have tried every combination of things I can think off, always to the same result.

Edited by clown_baby
SOLVED
Link to comment
Share on other sites

Yep, didn't read, just looked at the pics. Ever tried using the "texture" instead of "solid" on blender? Right beside Edit/Object mode. I would guess you have flipped faces on those, the mesh is right there but the render is inverted. You'll see it as transparent on texture render.

Link to comment
Share on other sites

thanks to blackheart I loaded the parts into sketchup and exploded them. now I'm getting closer.

mbpMFj1.png

However now my mesh collider only applied to one aspect of the part. not the whole thing. Any ideas?

Link to comment
Share on other sites

However now my mesh collider only applied to one aspect of the part. not the whole thing. Any ideas?

If they're separate meshes in your 3d modelling program, you'll need to add the physics collider to each mesh individually

-or-

create a simple collider mesh which covers the whole assembly, then in Unity delete the colliders mesh renderer component and add the physics component to only the collider mesh

Link to comment
Share on other sites

  • 3 months later...
...snip...

So from what i see is that the main head part is to thin. you have to extrude it so it has thickness. Also check to see if the normals are facing the right direction. By default they should. I work in maya and had the same problem. So That was my solution. I just had to ensure that the parts were not thin like creating a plane for example.

Edited by Claw
snipped massive quote
Link to comment
Share on other sites

No worries mate, hey you got some crazy looking creations there, awesome. I need some help here now lol. I cant seem to get the animation working. In unity the animation plays, but i think i am writing the cfg file wrong. here`s what I got for my fleet carrier.

MODULE

{

name = ModuleAnimateGeneric

animationName = Hanger bay

startEventGUIName = Open Bay

endEventGUIName = Close Bay

}

MODULE

{

name = ModuleAnimateGeneric

animationName = Close bay

startEventGUIName = Close Bay

endEventGUIName = Open Bay

}

Link to comment
Share on other sites

No worries mate, hey you got some crazy looking creations there, awesome. I need some help here now lol. I cant seem to get the animation working. In unity the animation plays, but i think i am writing the cfg file wrong. here`s what I got for my fleet carrier.

MODULE

{

name = ModuleAnimateGeneric

animationName = Hanger bay

startEventGUIName = Open Bay

endEventGUIName = Close Bay

}

MODULE

{

name = ModuleAnimateGeneric

animationName = Close bay

startEventGUIName = Close Bay

endEventGUIName = Open Bay

}

In unity, make sure the animation for part is set to legacy, not generic. Let me know if this helps or if you don't know what I mean

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...