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 zgoncDevelopment · Nov 08, 2017 at 06:56 PM · physicsrigidbodycollision detectionforces

Any way to have a rigidbody not be affected by forces, but still collide with other objects?

If i understand unity's physics right, you can have kinematic rigidbodies which won't be affected by forces and also not detect collisions, non-kinematic rigidbodies which do both, and static colliders without a rigidbody that aren't expected to move. So I want my player character to not be affected by forces, because 1. for some reason, the camera (which is a child of the player gameobject) starts rotating wildly when the rigidbody is non-kinematic 2. I don't want my player to bounce off other objects 3. If I make it kinematic, I have to add rigidbodies to all of the scenes objects which would move when the player collides with them which is certainly not what i want (the constraints don't help, the player doesn't collide with the object anymore when all the constraints are enabled). Also I don't like to use the built-in character controller, as there doesn't seem to be a way to change the capsule Collider to anything else, however i need a compound collider on my player. So is there any way to do it?

PS: This is my first question here, so pls don't kill me

Comment
Add comment · Show 3
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 Glurth · Nov 08, 2017 at 08:10 PM 0
Share

I'm not sure I understand exactly what you are looking for. Does this help? "A trigger doesn't register a collision with an inco$$anonymous$$g Rigidbody. Ins$$anonymous$$d, it sends OnTriggerEnter, OnTriggerExit and OnTriggerStay message when a rigidbody enters or exits the trigger volume."

https://docs.unity3d.com/ScriptReference/Collider-isTrigger.html

avatar image zgoncDevelopment · Nov 09, 2017 at 05:38 PM 0
Share

Sorry if my question was confusing, but trigger colliders are not my issue. I want an object to still collide with others while not being affected by any forces. Thanks nevertheless for trying to help

avatar image Glurth zgoncDevelopment · Nov 09, 2017 at 06:46 PM 0
Share

I guess I'm confused by what forces you mean? "All" forces would include reaction forces due to collisions. The only other forces I can think of would be Gravity (a checkbox), and the AddForce function (just DON'T call it). Which am I missing?

Edit/addition: "2. I don't want my player to bounce off other objects " But you DO want to detect collisions? If not to bounce off each other, I fail to see why triggers won't work.

2 Replies

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

Answer by Bunny83 · Nov 08, 2017 at 07:27 PM

No, that's not possible. Collisions are detected when a non kinematic rigidbody overlaps another collider. Collisions and the collision response depend on the physics materials of the colliders.

You can try using a kinematic rigidbody and use SweepTest to manually test if the rigidbody can move to your target location.

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
1

Answer by Mazer83 · Nov 08, 2017 at 09:57 PM

Yes it is possible. Just use a collider and check the box that says: "TriggerCollider". Use OnTriggerEnter, OnTriggerExit, etc.. to detect collisions.

You can set the "isKinematic" member to false, so that it isn't affected by forces.

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 Bunny83 · Nov 09, 2017 at 11:14 AM 0
Share

There's a huge difference between trigger events and collisions. Triggers just tell you that you entered / exit the trigger but not where or how much. The important information that collisions give you / the physics engine are the actual collision points and the collision normal which are necessary to properly handle collisions (in the sense of stopping your object when you hit a wall).

Trigger serve a different purpose.

avatar image zgoncDevelopment · Nov 09, 2017 at 05:46 PM 0
Share

$$anonymous$$azer83

I think you didn't understand my question right, I updated it now so that it hopefully is clearer what i mean. I don't only want to check if it hits another collider, I want an actual collision to happen, the difference of which Bunny83 already explained. Sorry for the bad formulation of the question, I should have made it clearer in the first place.

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

143 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

Related Questions

Solar System Simulator Orbits Not Working 2 Answers

How do I "remove/disable" collision? 3 Answers

Inconsistent collision detection on slow-moving objects 0 Answers

Always Get Same Physics Collision Rebound Force 1 Answer

Move rigidbody to position and still have forces act on it 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