Jump to content

Collider Mesh Flipping


Radion

Recommended Posts

I\'ve recently been restarting work on the Ascaron Aquanautics project after having been busy for the past week. I imported the .blend file into Unity as per C7\'s tutorial, and everything worked as it should. Then, upon importation of the complete part into KSP, the collider mesh not only appears in full white regalia, but is also flipped backwards on its axis, leaving it open to be seen. Has anyone encountered this sort of problem, and if so, are there any solutions you know of? If you need any more information, please tell me.

Link to comment
Share on other sites

Oh man was I ever frustrated by flipped/rotated colliders. Here\'s what I find works every time:

Build your model, reset all your origins to a common central point.

Drag/drop your .blend file into your Unity project. Drag/drop that underneath your PartObject that you create. There should be two models to expand underneath that.

Here\'s where I kept getting messed up: don\'t delete your collider mesh. Simply select it, and in the inspector window, uncheck Renderable, Cast, and Receive Shadows.

Select the actual model (third level down in the Game Object heirarchy; PartObject-->BlenderImport-->TheActualModel).

Then insert Game Component->Physics-> Mesh Collider.

Then drag the wireframe body of the collider (in the project window, below the BlenderImport - the icon with wires, not the blue one) into the mesh line of the Mesh Collider that is applied to your model.

If needed, I\'ll post a screenshot when I get back on my Computer.

Link to comment
Share on other sites

There\'s another way you can do it, too.

Once imported properly into Unity, drag the part into the GameObject you created in the heirarchy. Expand the heirarchy and find each collider listed, then apply the Physics -> Mesh collider as Admiral suggested.

Once you do that, you can delete the Mesh Renderer and Filter, leaving on the Mesh Collider attributes on that specific collider object (be sure to check 'convex' too!)

If one of those colliders need to provide collision to any animated object, just parent it to that object in the hierarchy. I found that you need to have the collider\'s pivot/origin within the mesh in order for it to be moved properly during the animation; Otherwise it rotates it around the distant pivot and causes it to move oddly.

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