Jump to content

Collision mesh, attachment points etc.


Recommended Posts

I model one or more primitive in my 3d program close enough to the real model( i use blender ) and name it something like colliderxxx just to remember it, then when I import it in unity I set the mesh collider attribute for the parts colliderxxx and remove the mesh render attribute

The attachment points are defined in the .cfg file, the coordinate are based off center point of the model you made http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation#Node_Definitions

You need to set the same scale in your 3d program ( meters )

Link to comment
Share on other sites

I'm glad that you decided to use my suggestion. :)

You may add a collision mesh as a simple shape in Blender, setting it to not be rendered; or in Unity you may set your existing mesh as a collision mesh also. That's my preference.

In your configuration file, you are able to set the attachment points. I started by working with a copy of an existing stock part .cfg file.

As the others above indicated regarding part scale, set the default scale to Metric. Edit: You may also control scale in the .cfg file.

I recommend this link: http://forum.kerbalspaceprogram.com/threads/25482-TUTORIAL-Getting-Started-With-Unity-BACK-FROM-THE-DEAD%21

Edited by Dispatcher
Link to comment
Share on other sites

  • 3 weeks later...
So. Now i know how to add collision meshes, attachments etc. But last two questions:

HOW THE HELL DO I ADD THOSE F****** TEXTURES???

And how do i export model from blender to unity?

Ah and probably how do i install those part tools?

Sounds like you are sort of in the same boat I'm in. Although I can get the textures to work relatively easily from my last attempt a few weeks ago. You have to use the UV unwrap features in Blender. Check out youtube, Andrew Price has some good tutorials if you need them. Of course there is a certain art involved when it comes to figuring out exactly how a mesh needs to be unwrapped.

I think I commented on another thread somewhere but can't find it ATM (maybe i should check my profile/recent posts ;) ).

The problem I'm having now is I finally got my connector nodes setup via the config file, and they're not magically floating in the air. The problem I'm having is only one of the nodes seems to connect, usually the top of bottom depending on which one i list first. Part of the problem I'm thinking is part rotation. It's oriented in blender to where z is up, if I leave it like that, it ends up on its side in Unity and KSP (even if I rotate the game object and/or the model its self (have done both). Rotating it 90 degrees on X puts it the right way around in Unity though and KSP though. Although no matter what only one node connects. Using the mesh collider component btw.

Though, maybe it's because im starting with a nurbs curve in Blender, then converting to a mesh and using spin to make it round. Although I've set origin to center of mass and zeroed everything out and applied scale, rotation and location (maybe thats part of the problem).

Think I'll try again with just a simple cylinder and see if that makes a difference.

...fun times :)

Update: I don't know what I did but I got it working now, even with the original model I was trying. Still need to adjust the attachment node locations but thats not a big deal. I must have done something different, either in the config file or in Unity, no clue what though LOL. I know...so helpful haha.

Of course, the scaling issue is still there, even though scale was 1 in Blender, and diameter (well x and y) were 1 meter, and all the scaling in unity is 1, the part still comes out between 0.625 and 1.25 in the game.

Have tried setting both scale and rescalefactor at 1, and tried them both separately, in the config.

Edited by Sma
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...