Jump to content

Engine Collision Problems


Recommended Posts

I've been working on an engine for a while now, and everything seems to work (thrust, effects, gimbal, etc) except when I place it in the editor. When I try to pick it up again (to move or delete or whatever), it doesn't light up like a part usually would, and I can't pick it up. Is this a common problem? I wasn't able to find it on the forums, so if somebody can help me I would really appreciate it.

Edited by xmrsmoothx
Link to comment
Share on other sites

Yup. If in doubt,

explains is nicely from the 8 minute mark onwards.

For an engine, it's probably better to use a couple of purpose built meshes (or standard primitives) for colliders, though.

covers it rather well around the 8:30 mark too.

EDIT: Try making your collision mesh simpler, maybe just a capsule collider and see how that goes.

Link to comment
Share on other sites

Yup. If in doubt,
explains is nicely from the 8 minute mark onwards.

For an engine, it's probably better to use a couple of purpose built meshes (or standard primitives) for colliders, though.

covers it rather well around the 8:30 mark too.

EDIT: Try making your collision mesh simpler, maybe just a capsule collider and see how that goes.

Hi, thanks for the advice. I used a capsule collider but it's still untouchable in VAB. Is there anything else I can do?

Edit: That video has the mesh collider on the model object, not as a separate one. Is that what I've done wrong?

Edited by xmrsmoothx
Link to comment
Share on other sites

The first video isn't wrong, it's just not best practice. What you've done is actually better, though if you're going to keep it as a mesh collider I'd simplify it a good deal. Ignore that for the moment - let's try and getting it working first :)

As long as you've got a convex collider it ought to be selectable in the editor. Are there any error messages in the output_log? Either when the part is spawned, or when the .mu is compiled during game start?

Link to comment
Share on other sites

The first video isn't wrong, it's just not best practice. What you've done is actually better, though if you're going to keep it as a mesh collider I'd simplify it a good deal. Ignore that for the moment - let's try and getting it working first :)

As long as you've got a convex collider it ought to be selectable in the editor. Are there any error messages in the output_log? Either when the part is spawned, or when the .mu is compiled during game start?

No, unfortunately there's no errors when compiling parts or spawning the part. Here's the components on the model part if that matters at all.

7n110nhtxv7qrhvzg.jpg

Link to comment
Share on other sites

Does the collision mesh have more than 255 triangles? That could be a problem. When you tried the capsule collider, did you use that in place of the other mesh, or in addition? I'd try just one, very simple collider and see if that works.

Wherever I can get away with it, I try to use a 12-sided cylinder, like the fuel tanks, or even simpler. Obviously sometimes you don't have a choice, and might need several collision meshes, or other complexity. But even for an engine, usually a capsule or cylinder collider is fine.

What works for me: Collider as a separate mesh in Blender. After import into Unity, remove collider's mesh renderer, add mesh physics, and click "convex". Done. As long as the collider isn't overly complex, this should always work.

Nice model, BTW!

Link to comment
Share on other sites

I've tried mesh, capsule, and box colliders, and they all seemed to have no effect. These aren't in addition to the mesh collider, but in place of. I'll try making a completely different mesh collider in blender and see if that does anything different.

Thanks for the help.

Link to comment
Share on other sites

Hmm, that is weird. Click the "center" button on the Unity Ui to swap it to Pivot, and check where the pivot of the collider object is. It needs to be within the mesh itself.

In fact, another thing to try, drag the collider and thrustTransform object in the hierarchy so that they are parented to the "model" object - since I assume your part exporter script is on Gameobject, it is ignored in the hierarchy and that just leaves 3 separate top level objects which might be preventing KSP from recognizing the collider.

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