Jump to content

Looking for help on making zombies break down walls and they respawn.


Bomberman
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

 Share

×
×
  • Create New...