Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by CG-DJ · Aug 30, 2013 at 08:15 PM · aiplatformercollisionsenemiesignore collisions

Controlling when enemies walk on top of each other.

Ok, I'm fresh out of ideas here. I'm making a zombie platformer. When the zombies are chasing the player, and they run into something, I have them attack it. The problem is, when I have multiple zombies attacking something from the same side, only one zombie can attack the object at the same time (its a 2D game). I want the zombies to be able to walk through each other and attack the object together, so that when there is a horde of zombies, they can get through obstacles very quickly.

The problem is, if I set the zombies so that they ignore collisions with each other, then when they stack up on an obstacle to attack it, they will all be on top of each other. Then when the obstacle is destroyed and they continue to chase the player, they will continue to walk on top of each other and they will look like 1 enemy.

An alternative is to set up a system where the zombies don't ignore collisions with each other, but rather when they stack up in a row at an obstacle, they transfer their damage to the first zombie, who then attacks with more damage (or something like that). The problem is, this doesn't give the horde effect I want. I don't want it to look like the zombies are lining up and are far away from an obstacle, but can still attack it from far away.

So I guess I really want to know is this. Is there a way to make the zombies spread out from each other, but still horde and attack an obstacle when they are attacking something.

I hope that makes sense, thanks for the help!!!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image getyour411 · Aug 30, 2013 at 09:11 PM 0
Share

An expanding and collapsing solution - hm, what are you using as your collider agent on the zombies? A primitive or a mesh collider? If you are using a primitive like a sphere or capsule or something, perhaps you could adjust its radius up/down based on the behavior you want.

avatar image robertbu · Aug 30, 2013 at 09:14 PM 1
Share

Perhaps can mitigate this problem by adding in some randomization of the movement for your enemies. Without seeing your enemy code, I cannot provide specifics, but things such as varying the speed and the path followed to a goal. Introduce some inaccuracies in the targeting until the enemies are within a certain distance to the goal. They would still collect at goal points, but would tend to spread out upon release to the next goal.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D Platformer Ai Movement Decision Making Problems 0 Answers

Aggro behavior for RTS game 1 Answer

AI & pathfinding for 2D platformer - how to approach? 0 Answers

Basic enemy AI for 2.5D Platormer 1 Answer

2D 360 degress platformer example needed 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges