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
1
Question by McMutton · Jul 23, 2011 at 04:16 PM · rigidbodycollidertriggerinterfere

Box collider triggers interfering with rigidbody movement

Ladies. Gentlemen.

A good bit ago, an interesting issue had suddenly arisen. There was something interfering with the movement of my character (Who has a rigidbody). I really had no idea what was going on, but I finally discovered the cause the other day. For some reason, the colliders that I'm using as attack hitboxes are the source of the issue. Of course, they're set as triggers.

It's the most annoying thing; rigidbody.velocity only actually works in one direction (Can't go up or right. Only left), the character sometimes gets stuck in one of the colliders, etcetera. Even if I'm nowhere near any other colliders, the issue persists. I had tried messing with the physics settings as well, but if they ignore collisions, then they're useless as triggers.

So what's going on here? If a collider is set to trigger, shouldn't it be unable to mess with objects?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Chris D · Jul 24, 2011 at 01:26 AM

Yes, colliders with isTrigger = true will not interact with physics objects (physically...).

Check the rest of your setup and code, it has to be somewhere else.

Comment
Add comment · Show 1 · 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 McMutton · Jul 24, 2011 at 02:58 AM 1
Share

But wouldn't the fact that the issue goes away after getting rid of said colliders mean that they're the cause?

avatar image
0

Answer by aldonaletto · Jul 24, 2011 at 03:16 PM

If you're using the Character Controller, you're a victim of the "added colliders bug": if you child to the Character Controller some object with a collider, the controller movement becomes very weird: some directions are blocked, or it strafes when trying to go in some directions, or moves to the wrong direction - all depending on how the childed collider intersects the capsule. If this is the case, avoid the added colliders to touch the Character Controller capsule. Setting Is Trigger in such colliders also solves the problem, if it can fit your game logic.

Comment
Add comment · Show 3 · 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 McMutton · Jul 31, 2011 at 03:09 PM 0
Share

Those are definitely the issues I'm getting, aside from using a Rigidbodyrather than a Character Controller. But in order to get good results with movement and such, I'm using a box collider to give the character a consistent hitbox. None of the triggers are hitting it, but could that be doing anything?

avatar image aldonaletto · Jul 31, 2011 at 10:30 PM 0
Share

It seems that the main collider "thinks" it's colliding with its children. In the Character Controller, the problem ceases when the childed collider is at a certain $$anonymous$$imum distance from the character - but also if it's set as a trigger (opposite to your case). I have some illogical suggestions to you:
- Try to move the triggers away from the main collider and check if they still disturb the movement;
- Add kinematic rigidbodies to your triggers;
- Change the triggers shape;
These suggestions don't make too much sense at all, but that's the way bugs are: complete nonsense. $$anonymous$$aybe some illogical thing like this may prevent the bug.

avatar image McMutton · Aug 06, 2011 at 08:27 PM 0
Share

From what I can tell, the issue is actually stem$$anonymous$$g from my triggers intersecting the Skinned $$anonymous$$esh, despite the fact that it has no collisions, is on a layer set to be ignored by everything, and has its bounds set to zero. Gaaah!

avatar image
0

Answer by testure · Jul 31, 2011 at 03:35 PM

FYI- I ran into this problem as well:

http://answers.unity3d.com/questions/131688/triggers-with-rigidbodies-are-pushing-each-other.html

Never figured out what was doing it, but one day it just stopped. I'd been working in a totally unrelated part of the game, so there's no way I 'accidentally' fixed it. My guess is that it's a rogue bug in Unity.. I haven't figure out a way to reproduce it in a sterile environment. I would recommend sending your project files to Unity to examine (if you're able to). From my experience it is extremely frustrating, and the fact that it just came out of the blue and disappeared the same way is very concerning.

Comment
Add comment · Show 1 · 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 McMutton · Aug 01, 2011 at 05:37 PM 0
Share

Yeah, it came out of nowhere for me as well, the confounding thing.

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

6 People are following this question.

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

Related Questions

Physics Possibilities?: Angles, Penetration, Exceptions 4 Answers

Unity 2D Trigger Detection is not working. 6 Answers

OnTriggerEnter mesh collider problem 1 Answer

Rigidbody Trigger 1 Answer

Somehow not picking up trigger collisions 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