Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 theunsigned · Apr 11, 2019 at 06:06 PM · colliderprefabprefabscollider2dtag

some prefab collisions randomly stop working

My game has been working fine but, all of a sudden, some prefab collisions stop working. Usually, colliding with the player collects the prefab objects and processes them by tag; but, sometimes, only some prefabs with some tags work. It's always the same tags that stop working but I have no idea why, why it's not consistent, and if the tags have anything to do with the issue at all. When trying to test on my mobile device, the error always occurs on build. Nothing in the collider code has changed since it worked. I'm very confused.

Has anyone else run into this issue? If so, what should I look into?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Poon-Moon · Apr 11, 2019 at 06:13 PM

I've only experienced that when the objects move too fast and I've not had Continuous collision detection. If that is set, I guess you've checked the physics matrix of what's allowed to collide with what? And have you popped a debug on OnCollision and OnCollider - just incase one starts to fire in favour of the other?

Comment
Add comment · Show 2 · Share
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 theunsigned · Apr 11, 2019 at 07:12 PM 0
Share

I'll look into debugging. I'm just very confused because it worked fine until I opened it up and it stopped all of a sudden. Thinking about it, it seemed to work until I did the build. In your experience, has that impacted things at all? Strange that it only applies to specific tagged prefabs...

avatar image theunsigned · Apr 12, 2019 at 05:35 PM 0
Share

It turned out that when I migrated and changed some pieces of my project, I neglected to change collision detection to continuous. Thank you!

avatar image
0

Answer by surfuay · Apr 12, 2019 at 01:57 AM

few possible things

  1. sounds like you're using "gameObject.Find" or "gameObject.FIndWithTag" both of which have a tendency to get easily lost in consistency in your code. If that's the case I would recommend removing those and moving towards singletons.

your code would be a little clean so instead of

_player = gameObject.Find("Player").GetComponent

it would simply become Player.player.getCoins() (or whatever part of the player or other script your trying to access)

the other thing could be how you're calling the collision. One of the things that's thrown my games is in my 2D games i would add a Collider (incorrect) and then call it OnCollider2D (correct). So I had a collider and i was calling a collider but they were in different worlds. I would check your items that have colliders and make sure they're both 2D or not.

Comment
Add comment · Share
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

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

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

Change value one prefab NOT ALL 2 Answers

detect if collider is not touching anything 0 Answers

Getting a Raycast to Classify Objects as the Same Thing 0 Answers

Save a gameobject as prefab on button press.,Is there a way for the player to create a prefab with a button press? 3 Answers

Raycast ignoring tags problem 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