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 Lockstep · Feb 18, 2013 at 10:36 PM · rigidbodycolliderstatickinematic

Controll squeeze of rigidbody between static collider and kinematic rigidbody.

Hi. Is there a way to detect and controll if a rigidbody is beeing squeeze between a static collider and a kinematic rigidbody?

This is my setup: I got a nonkinematic rigidbody as player. It lives inside of a box of static colliders. Those are the absolute boundaries in which the player is allowed to move. Furthermore I got kinematic boxes moving with rigidbody.MovePosition. They are able to push the player arround which is intended. However if the player gets stuck between the moving box and the boundary, he will be pushed throug the static collider and leave the allowed area.

How can I detect if this is happening or how can I tell the player to be pushed through the moving box rather than the static collider? Is there an easy way to do this or do I have to force him by script (would be harder to handle than simply setting colliders)? Thanks in advance.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by xikky · Feb 21, 2013 at 07:07 PM

If i'm understanding you well, you might need to use the following script which can be found here.

This script is used to stop objects going through other objects (generally due to large forces created).

In your case, attach the script to your character. Add a new layer and you can name it anything, such as 'Boundary'. All objects making the boundary put them in this layer. In you character inspector find you script and select the layer 'Boundary'.

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 Lockstep · Feb 21, 2013 at 09:16 PM 0
Share

First of all: Thank you for your answer. This is probably not your fault, but the script is incredibly bad. It is redundant, framerate dependant, only triggers if you move at a very high speed which depends on the size of the collider, can't handle colliders wich equal extends in all directions and causes massive jittering when it takes effect. And I'm not even talking about what is happening when you try to walk diagonally into the wall or worse into a corner.

Aside from that, I'm not looking for a script. I wanted to know if there is a way to let PhysiX know how it should handle the conflict on its own. $$anonymous$$y particular problem serves more as an example for the general question, but thanks for the effort.

avatar image xikky · Feb 23, 2013 at 10:19 AM 0
Share

Yes I know, but this is the only method to stop collisions at high speed that I know of, and it works. It is true that it does cause jittering (only when the speed is really high) but I normally try to find work arounds so not to show the jittering.

avatar image Lockstep · Feb 23, 2013 at 12:36 PM 0
Share

The speed is not really the problem. The collision conflict which happens when the character gets squeezed between two colliders is. Writing a script which forces the character inside of the given bounds shouldn't be a problem for me either. I simply wanted to know if I can let PhysiX handle the conflict on its own in a controlled manner.

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

10 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

Related Questions

Having a kinematic rigidbody detect collision with a collider without a rigidbody 7 Answers

Collider not stoping the object second time 1 Answer

Is moving a collider without rigidbody bad? 1 Answer

Unity creating static colliders 1 Answer

Using transform in kinematics rigid body 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