Jump to content

Sliding door collision problem


flysouth

Recommended Posts

I created a swing door which had a collision mesh as a child. This works well and blocks player when closed and allows through when open. I have now created a sliding door using the same technique but in T3D the collision mesh does not move with the door. I read that this works if you put a bounding box around it but I tried that and things remained the same. I know that there is a door resource somewhere but I would like to do this without c++ changes.

If I view it in the T3d editor and show the collsion mesh it does move with the doors as can be seen in the image. However in the mission you can see in the middle a white square which seems to be the collision mesh. If I turn off collision then the player can pass through.

edit.jpg.de5d8537555db446d5924e6b7ec2d3b0.jpg

map.jpg.fa71f8a5a5951be13debd66033a36594.jpg

Link to comment
Share on other sites

I did some more testing and discovered that I can shoot through the collision mesh and after 3 shots then it works correctly.

I made a new set of test doors just 2 cubes and they did exactly the same.

This is in ver 3.8.

It is almost like there is some sort of 'damage' layer on the collision mesh which once shot 3 times is destroyed?

Link to comment
Share on other sites

Stock collision uses the root position. That is that only the base collision without animation is the one being used.

Using physX or bullet ~may~ avoid that but that uses a lot of c++ changes, I think.


What I use:

1. The door has no collision at all.

2. Create invisible TSStatic objects but with the collision the size of each door.

3. In script, use setTransform(...) with the TSStatic objects to position them where you need the collision.

Link to comment
Share on other sites

I created a swing door which had a collision mesh as a child.

 

Just to be clear, how exactly did you make the collision mesh a child of the door? Did you properly create and add the collision mesh in the model?


@irei1as : That's an interesting approach.


It's been awhile since I messed with moving collisions but IIRC isn't it possible to just animate collision shapes in the model itself? Seems like I was able to do that once, but it required using more than one collision shape. /shrug

Link to comment
Share on other sites

I created the mesh when I created the model. Because I made it a child of the model it moves when the door moves. The mesh does work but only after I have fire a few shots through it. I read somewhere that there was a player cash problem with moving collision meshes. The post was from a couple of years back so I am not sure if that still applies.

Strangely I did not have this problem with my swing door which was made the same way.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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