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 wheelbarrow · Aug 08, 2013 at 06:14 AM · layersphysics settings

Some colliders work, some don't...

I have a bit of a conundrum with my colliders, so I am appealing for suggestions as to what could be happening. I have a zombie model in my scene, that follows and then melee attacks the player (top down 3rd person). The zombie has a box collider on the model to take damage, and for the melee damage to the player, I have placed a sphere collider on each hand which are triggers. The player cannot damage the zombie. The zombie model and the sphere colliders are on different layers, and to avoid collision conflict, I keep them separated with the physics matrix in edit>project>physics, and everything works fine.

I also have sentry guns that can kill the zombies if they come within range, and this also works fine. However, if I duplicate the zombie model in the scene, everything still works regarding the player damage, but they can no longer be killed by the sentry guns. I have narrowed the cause down to the 2 spherical trigger colliders, because if I turn the colliders off in the inspector, the zombie gets gunned down by the sentry guns as they should, but obviously I can't deal any damage to the player with the colliders turned off.

My question is, I guess, what could possibly change between an original model in a scene and its' duplicate, that would suddenly render the sentry gun damage useless because of the sphere colliders? The damage script on the bullets is a basic On Collision apply damage script, but this seems to be a moot point, seeing as how with the original zombie model everything works perfectly...it's only the duplicate that has the problem. Sorry for the text wall, and thanks for any/all replies.

Comment
Add comment · Show 6
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 reppiz01 · Aug 08, 2013 at 09:18 AM 0
Share

$$anonymous$$aybe some pieces of code would be fine.

Do you check the name in the "OnCollision"$$anonymous$$ethod? If so, maybe the original has the name "Zombie" and the duplicate the name "Zombie(Clone)" or something like that?

avatar image meat5000 ♦ · Aug 08, 2013 at 09:22 AM 0
Share

When you damage a duplicate, does the damage occur to the original? A straight duplicate would also duplicate tags and names.

Also what are the sphere colliders a trigger for?

avatar image meat5000 ♦ · Aug 08, 2013 at 09:24 AM 0
Share

$$anonymous$$aybe, ins$$anonymous$$d of duplicating the Zombie model, set up a script to use Instantiate, which makes a clone with which you can separate names and still use the same tags.

avatar image wheelbarrow · Aug 08, 2013 at 07:14 PM 0
Share

Thank you for the responses. @ reppiz01 - one of the reasons I used the physics setting was to avoid the possibility that I could be getting an incorrect name in an ignore collision script on the duplicate, so this isn't the problem, though I will check again - the bullets OnCollision script specifies no particular name, its a generic whatever you run into script.

@ meat - no, the original does not take damage if the duplicate does, and the spheres are triggers for a damage script on the player toon - better to have them as triggers than colliders I thought to avoid any collision issues with their own box collider, and like I say in the post, the system works great, except for when I duplicate the model - this inability to duplicate also makes creating a prefab pretty much impossible, which is what bothers me the most (apart from it not working lol)...and I will try you suggestion of duplicating via a script.

Apologies for late reply, I'm on the other side of the planet :)

avatar image reppiz01 wheelbarrow · Aug 09, 2013 at 07:56 AM 0
Share

china? ...i bet it is china!

avatar image meat5000 ♦ wheelbarrow · Aug 11, 2013 at 10:47 AM 0
Share

Wanna just post your scripts? :P

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

16 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

Related Questions

How to duplicate several layers in a tilemap?,How to duplicate layered tilemaps? 0 Answers

Differentiate one layer from the other. 0 Answers

Setting Layer Weights properly 0 Answers

How do i customize the settings in 2 different surfaces 0 Answers

How do you make a mesh visible to certain cameras? 1 Answer


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