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 al4crity · Sep 20, 2013 at 02:22 AM · collisionrigidbodyjump

RigidBody collision is unaccurate

Hi!

I am trying to create my first Unity game, and have encountered a slight problem.

Player object is a cube, with a rigidbody object attached to it. Rotation is locked on all axis, movement is locked on X, thus it does not rotate and only moves on the Y and Z axis.

I generate a line of 1x1x1 cubes, using the same X and Y, and incrementing Z by one each time.

My problem is as follows: alt text

The cube seems to move "inside" of the world cubes, and thus sometime (not always, but often) it seems to collide with the corner of the next cube and thus start jumping. (If I unlock rotations it will start rotating wildly.) Resulting in small jumps like:

alt text

Is there any way to prevent this, except just locking the Y velocity to zero or less unless jump key is pressed and OnCollisionExit?

I have tried changing to Continuos, and Continuous Dynamic collision, with no difference.

I apologize if the answer is obvious, but I have looked through several tutorials and searched google, and been unable to find any answer. Perhaps I do not know the correct terminology, and thus haven't found it. Any help would be appreciated.

Thanks for reading.

Comment
Add comment · Show 2
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 YoungDeveloper · Sep 20, 2013 at 02:12 PM 0
Share

Are you checking the collision in Update() function or FixedUpdate()? For physics, It's better to calculate collision inside FixedUpdate, because it's called before update.

avatar image al4crity · Sep 20, 2013 at 02:40 PM 0
Share

I do not check manually, I have just created cubes which form the ground and a single moving cube which has a rigidbody component attached to it.

2 Replies

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

Answer by robhuhn · Sep 20, 2013 at 02:56 PM

have a look at my question here: http://answers.unity3d.com/questions/399064/prevent-collider-intersection.html

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
0

Answer by Owen-Reynolds · Sep 20, 2013 at 02:01 PM

This is normal. Think about all the times you've been snagged on nothing in any other game.

It's fixed by cheating one way or another. Could pull the player up a tiny bit and check off UseGravity (so she will never touch those cubes.) Or could put a thin invisible floor on top of everything. Or could give the player an (invisible) child sphere at the base to roll over those gaps. Or (and not sure if this works) make the floor cubes a tiny bit wider.

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

18 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

Related Questions

Keep Horizontal Momentum after Jump 2 Answers

Collision Problem with Rigidbody? 1 Answer

A node in a childnode? 1 Answer

how to make an Explosive rigidbody trigger by another collision box 0 Answers

¿How to make a ball react properly against two different physic's materials? 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