Jump to content

Collision Mesh Question


Recommended Posts

doing so become real intereting with complex part with many different fonction.

As Touhou explain in is Eva Iva tuto, he first create a basic part with a shared origin. You can do the same for anithing else isolotating each fonction you want to add to a part in a file.

Breaked prefab from a single blend don't auto update once in unity for iteration fix and testing.

Multiple prefab help doing thing faster as each fonctionnality you want to add to you part is separate from other and will auto.update in unity.

Also a faster way to get quick what's work and what don't you can faster turn on/off each prefab/blend file (as well as turning on/off a perticular transform in one of the prefab).

will save you lot of repetitive config param in unity.

Link to comment
Share on other sites

In Blender, I'm trying to make a collision mesh to import into Unity. Is it best to just make another .blend file with the mesh?

It's best to avoid mesh colliders entirely and use multiple primitive colliders where you can. If you do need a mesh to wrap a mesh collider around then it doesn't matter how you import it, if it's easier for you to model it in a separate file then go ahead and do so.

Link to comment
Share on other sites

It's best to avoid mesh colliders entirely and use multiple primitive colliders where you can. If you do need a mesh to wrap a mesh collider around then it doesn't matter how you import it, if it's easier for you to model it in a separate file then go ahead and do so.

You mean like... creating multiple box or cylinder objects in Unity to approximate the shape of the model and designating them as colliders?

Link to comment
Share on other sites

You mean like... creating multiple box or cylinder objects in Unity to approximate the shape of the model and designating them as colliders?

If you want to do it that way yeah, then delete the mesh filter & mesh renderer components afterwards. Personally I just add the box colliders (to extra empty gameobjects if the visual mesh is a single object) and adjust them numerically to fit.

Unfortunately unity doesn't have a flat-ended cylinder primitive so a inline rocket parts usually will need a mesh collider but for things like rover parts it's worth looking at.

Link to comment
Share on other sites

each collider = more phy engine calculation wich is not good at all as it's actually one of the main limit,

for testing/first shot purpose when you try to get a perticular fonctionnality to work (like your tries with emissive) don't bother you too much with collider but keep in mind that it's good to get a plan to simplify them as much as possible for your finished part.

bP8lr5U.jpg

Link to comment
Share on other sites

each collider = more phy engine calculation wich is not good at all as it's actually one of the main limit

Is it actually the colliders' date=' or is it the rigidbodies/joints that are the limiting factor in KSP? Even if not the colliders though, it is a good idea the keep the performance load down to allow more time to be spent on the other physics components.

From the unity documentation (the engine KSP is based on), emphasis mine:

Colliders

Collider components define the shape of an object for the purposes of physical collisions. A collider, which is invisible, need not be the exact same shape as the object's mesh and in fact, a rough approximation is often more efficient and indistinguishable in gameplay. The simplest (and least processor-intensive) colliders and the so-called primitive collider types. In 3D, these are the Box Collider, Sphere Collider and Capsule Collider. In 2D, you can use the Box Collider 2D and Circle Collider 2D. Any number of these can be added to a single object to create compound colliders. With careful positioning and sizing, compound colliders can often approximate the shape of an object quite well while keeping a low processor overhead. Further flexibility can be gained by having additional colliders on child objects (eg, boxes can be rotated relative to the local axes of the parent object). However, you should be sure that there is only one Rigidbody and this should be placed on the root object in the hierarchy.

There are some cases, however, where even compound colliders are not accurate enough. In 3D, you can use Mesh Colliders to match the shape of the object's mesh exactly. In 2D, the Polygon Collider 2D will generally not match the shape of the sprite graphic perfectly but you can refine the shape to any level of detail you like. These colliders are much more processor-intensive than primitive types, however, so use them sparingly to maintain good performance. Also, a mesh collider will normally be unable to collide with another mesh collider (ie, nothing will happen when they make contact). You can get around this in some cases by marking the mesh collider as Convex in the inspector. This will generate the collider shape as a "convex hull" which is like the original mesh but with any undercuts filled in. The benefit of this is that a convex mesh collider can collide with other mesh colliders so you may be able to use this feature when you have a moving character with a suitable shape. However, a good general rule is to use mesh colliders for scene geometry and approximate the shape of moving objects using compound primitive colliders.

Link to comment
Share on other sites

I have a tapered triagular shape (tapered from 2.5m to 1.5m in the z direction over the x direction), where the y-size varies from 12m to 2m. A box wouldn't be a very good collider for my model, but a rhomboid of some kind might be.

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