Bomberman Posted October 4, 2014 Share Posted October 4, 2014 I'm trying to make a game basically about your on an island stranded, and you can find shelter in houses from zombies/mutants. I need some help on the script for them breaking down a wall/fence/railing. One more thing I need help on is the auto respawn of the mutant/zombie. Quote Link to comment Share on other sites More sharing options...
nick.ace Posted October 4, 2014 Share Posted October 4, 2014 For breaking down a wall, the easiest way to go about doing this is to make a wall out of broken pieces (each with unique physics shapes) and preferably add a force to at least one of the shapes. Your would replace a solid wall with the broken pieces once the zombie action occurs. I'm still not sure what your design is, so I can't really give much more advice on it. You should provide more details as to what you mean by autorespawning, because there are a bunch of ways to handle it, and it depends on the design of your game. Quote Link to comment Share on other sites More sharing options...
Rick Posted October 4, 2014 Share Posted October 4, 2014 So I assume you want to use the navmesh. I'm not sure if you can regenerate the navmesh and even if you can if it would be slow. What you can do is have your walls not be navmesh obstacles. Then attach scripts to them to ID them as walls. So now your navmesh goes through the walls. However, when zombies collide with "walls" (you can ID walls using self.entity:SetKeyValue("type", "wall") inside the wall script that you attach to them), you can call self.entity:Stop() (so they stop moving) and start having them play their attack animation to hit the walls. From there you can give your walls health and you could either swap out slowly broken wall models based on % of health and then at the end do what nick says where you swap out a solid wall with a prefab wall that has many separate pieces that all have physics and then give them all mass and watch them fall to the ground. Quote Link to comment Share on other sites More sharing options...
Einlander Posted October 4, 2014 Share Posted October 4, 2014 I made a script a while ago that removes a wall when it's health is gone. Feel free to use it as a base. http://www.leadwerks.com/werkspace/files/file/529-simple-object-destruction/ Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted October 4, 2014 Share Posted October 4, 2014 You groove has as tutorial that maybe helpful. http://www.leadwerks.com/werkspace/topic/10347-destroyable-physics/ Quote 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.