Jump to content

AddAttachNode to a part with no existing nodes?


Recommended Posts

Has anyone successfully used AddAttachNode? I haven't been able to find any threads detailing it. I think it's what I need - I need to be able to add a part to an existing part programmatically, so that it behaves the same as if you had attached it in VAB/SPH.

I've tried just using

GameDatabase.Instance.GetModel()

and just setting the transform as the parent, but the part only moves when the core of the transform moves, I need to to be attached to the collider rather than the gameobject directly, if that makes sense.

The point would be to automatically add the node and then attach a part to that node.

So would I be able to use AddAttachNode to accomplish this, or if not - is there another way?

Thanks in advance.

Edited by TwistedMexi
Link to comment
Share on other sites

the problem is, you need to find out the orientation/rotation of the hull peace you want to attach to..

the only way I heard of is to use raycast.

This will give you a "HitPoint" - this hit point should have a rotation according to the hull peace you hit.

But still, programmatically => without mousclick, to get such a hit point at the right position might still be hard..

Kas does what you need - but it does it after a mouse click to find the location..

How exactly they do it, is nothing I could help with..

HTH

Link to comment
Share on other sites

That's clever, I'll check into it, thanks!

@philotical I think that's probably what I'll have to do to keep the orientation straight, though like you said it'll be difficult to keep that on a constant basis.

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