xtom Posted March 3, 2015 Share Posted March 3, 2015 I have a problem with monster walking through closed doors. The collision stops it sometimes but then sometimes he just passes right through. I thought maybe the MonsterAI speed was too high so I reduced it from 6 down to 0.7 for a slow walk speed and still he can pass through the door. The door and frame are models and the walls/floor are csg. I thought maybe the collision shape on the door was too thin but it's about the thickness of the 16 csg wall so I'm not sure why it's happening. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
YouGroove Posted March 3, 2015 Share Posted March 3, 2015 I think using navmesh navigation, the character controller just navigate trhough navmesh and don't pay attention to obstacles. You must use a raycast , so your monster will be able to detect some obstacle and then stops walking or choosr another destination. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted March 3, 2015 Share Posted March 3, 2015 What I've done before is put a script on the door and when the monster collides with it I stop it's navigation. You can do all sorts of things by knowing when anything collides with a door. 1 Quote Link to comment Share on other sites More sharing options...
xtom Posted March 3, 2015 Author Share Posted March 3, 2015 The strange thing is before I had buildings and walls with navmesh running right through them and the monster couldn't pass through the walls even though the navmesh passed through. It just kept walking into them which is what I was hoping for with the doors. I'm not sure why it's behaving different. I'll do some experimenting and see if I can make him make him hang around the door instead of walking through it. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
Rick Posted March 3, 2015 Share Posted March 3, 2015 I assume your walls don't have joints on them but your doors do? The joints create a means for the physics of the controller to push open the door. Personally I wouldn't use physics on doors. I would just rotate them via code when they need to be opened or closed. Quote Link to comment Share on other sites More sharing options...
xtom Posted March 3, 2015 Author Share Posted March 3, 2015 I'm just using the default SwingingDoor.lua on the door model. The good thing about the physics on the door though is that it pushes the player or enemy out of the way when it opens/closes which I like. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
Rick Posted March 3, 2015 Share Posted March 3, 2015 Yeah that is nice. Otherwise you'll have to do what I have to do which is do a collision check and check the state of the door (is in process of closing) and if so push the controllers backward with a force. Quote Link to comment Share on other sites More sharing options...
cassius Posted March 3, 2015 Share Posted March 3, 2015 I had this problem more than once and never solved it. My door had no joints. My character could not get thru center of door but could slip through the edge even though the door was slightly bigger than the door frame. I relied on physics and sometimes it worked, sometimes not. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
xtom Posted March 3, 2015 Author Share Posted March 3, 2015 In the swing door collision script I've set it so the monsterai is set to idle mode so he waits at the door instead of walking through it. entity.script:SetMode("idle") Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
Recommended Posts
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.