Jump to content

Animated Nif collision. Make collision move with object.


Recommended Posts

Hey guys.

I'm working on a mod at the moment. I'm a bit stuck with setting up collision for an animated object.

 

I have a nif file setup with an NiControllerManager and all animations etc are working fine.

I've attached the nif I'm working on. The collision is working, but I want it to move with the train.

Would somebody please take a look at my nif structure and tell me how I need to place the collision? I don't care about collision for the main track, only for the train itself.

The collision is just taken from a vanilla road piece. I would really like to have proper collision for the train, but I can't create custom collision for the train.

 

Download nif

Link to comment
Share on other sites

To make the collision move with the visible mesh, you need to attach the collision to an NiNode and animate the NiNode. However, certain flags have to be checked when the collision is created in order for it to move with an animation. So you have to either make the collision for the train (or find someone who will make it for you), or use existing collisions to approximate it.

 

If you want to try and approximate it, I recommend using multiple copies of metal doors, they have the right kind of collision and are a basic shape. To do so, you would want to:

 

1) Find a metal door to use

2) Delete everything but the collision info and visible mesh from that nif (don't save that one)*, and then copy what remains

2a) Right click the NiNode -> Block -> Copy Branch

3) In your mesh, right click the NiNode "ActualModel" -> Block -> Paste Branch

4) Position the door so it would line up with part of the train (make sure to apply all translations to the NiNode you copied, not the BSTriShape)

5) Repeat 3-4 until you've blocked out collision for the whole train

6) Delete the visible mesh (BSTriShape) from all the copied door NiNodes

 

You should now have collision for your train that moves with it. If you want the train doors to open, you'll have to separate them from the main mesh, and animate them separately. If you have the NiNode for the train doors as a child of the "ActualModel" NiNode like you need to for the collisions, it will move with the rest of the train for that part of the animation.

 

One last thing: You can't adjust the scale of a collision within the nif, you either have to make a bigger collision or (if you are placing it in the world and not making it buildable) you can adjust the scale of the placed reference.

 

*You'll probably need to delete some animation info, a BSXFlags node, and possibly a CPA node

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...