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
2
Question by testure · Jun 18, 2011 at 04:44 PM · physicsrigidbodytriggerkinematicpush

Rigidbody triggers are pushing a CharacterController..

I'm hoping somebody knows what's going on here and can help me figure out out- because it's a really intermittent problem that's bugging the hell out of me.

In my game, I'm using a large SphereCollider as an "aggro" trigger for an AI unit. It has a rigid body on it that is set to Kinematic, because A) it's not static, and B) if the player is standing still and the AI unit patrols past him, I still want the trigger to fire.

So therein lies the problem really- about 2% of the time, the trigger will actually push the player. It's very subtle- just a nudge, but it's obvious. Sometimes it's more than subtle and it seems like the collider is acting as an actual collider and not a trigger.

It's also worth noting that my player has a large sphere collider of his own to use as a 'targeting' trigger. It also has a rigid body set to kinematic. The player's targeting trigger is much larger than the AI's aggro trigger, and when these strange interactions happen, the AI's aggro trigger is always inside the player's targeting trigger. So the 'push' that happens is always the aggro trigger against the character controller (which also has a kinematic rigidbody attached).

Anybody have any idea what is causing this? I've spent the past week off and on trying to search for solutions and fix this issue once and for all, but I'm getting to the point where I feel like I've tried everything.

Comment
Add comment · Show 1
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 testure · Jun 18, 2011 at 06:22 PM 0
Share

I updated the question title to hopefully be a bit more descriptive so someone will see it and give me a hand ;)

3 Replies

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

Answer by testure · Aug 04, 2011 at 05:02 AM

This seems to have gone away with the passage of time. Still no idea what caused it, I can only assume I'm the victim of some freak unity bug.

Closing this question out since nobody had any suggestions anyway :P

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
avatar image
2

Answer by AlanChatham · Jun 22, 2011 at 05:14 AM

I'm a beginner, so this may not be totally correct. But I'm using this setup for my enemy spawn points, and it's working, so I have a bit of confidence in the answer. Is there a reason that you've got your sphere colliders set up as rigidbodies? If you're only using them as triggers, my understanding is that you just have the collider, tick the "Is Trigger" box, then when it interacts with other rigidbodies (i.e. other monsters, the player). So as long as you're not trying to make their aggro triggers interact with other triggers, remove the rigidbodies, and they'll still register trigger events, but won't be trying to push your stuff around.

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 testure · Jun 22, 2011 at 05:25 AM 1
Share

A trigger is a trigger, so long as the checkbox is ticked. If you're moving a trigger, while not required, if you don't add a rigid body to it, your scene graph is recalculated each frame that the trigger/collider is moving. This can be a HUGE performance killer.

As you get further along with unity, you'll hear that a lot- 'never move a static trigger', and that's the reason. The way you make a non-static trigger is by assigning a rigid body to it and making it kinematic, so that PhysX knows how to track it properly in the scene graph and doesn't have to recalculate each frame.

It's also worth mentioning, that if you don't have a rigid body on a moving trigger, when it moves across a static object that is also lacking a rigid body, it will not register a trigger. For example- if you have a trigger on an AI unit that is walking around, and you have your player stand in the AI's path, the AI will not be able to register a trigger from it unless one of the two have a rigid body attached.

Thanks for the post, and the bump ;)

avatar image AlanChatham · Jun 22, 2011 at 05:53 AM 1
Share

Wow, thanks for the info! I'm just noticing where the documentation says "These are GameObjects that do not have a Rigidbody attached, but do have a Collider attached. These objects should remain still, or move very little". I'm sure you've already thought about it, but I'm wondering if it'd be possible to add a second child collider to your player controller, then set up the collision filters on the AI aggro spheres to only deal with that? I know that's much more a workaround than an actual solution to what's going on with your game...

avatar image
0

Answer by Sungold · Aug 03, 2017 at 05:12 AM

It's happening to me to when my character holsters his firearm. The firearm's collider is set to trigger, but when he puts it away, it pushes the character controller. I put them on different layers and unchecked interaction in the physics tab, and I even modified my movement script to ignore collisions with gameobjects of that layer. No avail.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Kinematic Rigidbody Collider not colliding with Static Trigger Collider 3 Answers

How to add a Kinematic Rigidbody to a cube? 1 Answer

Tracking Force Added to Kinematic Rigidbody 2 Answers

Kinematics: Trying to get an object to land at a known point 1 Answer

Set velocity of kinematic rigidbody appropriately 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