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 samqweqwe · Feb 05, 2015 at 06:51 PM · physicsrigidbodyjumpingtiles

Preventing rigidbodys from jumping on a tiled map

hi, i have a map that is created using cubes that is generated during runtime. The player moves using the physics system, and looses health depending on the impact of the collision. The problem is that when the player slides along the map across two tiles, the player jumps as if there was a gap between the tiles or that they were not aligned. The positions of the tiles are correct, meaning that there should be no gaps. This can reduce the players health. Is there a way to fix this issue or a way around it? would it help if they were slightly overlapped?

Comment
Add comment · Show 4
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 VesuvianPrime · Feb 05, 2015 at 07:22 PM 0
Share

Would it be an appropriate fix to constrain the Y position?

alt text

avatar image samqweqwe · Feb 05, 2015 at 07:28 PM 0
Share

The player still needs to move on the y axis for intended jumping and gravity. Sorry, i didnt specify the movement of the player.

avatar image Mmmpies · Feb 05, 2015 at 09:10 PM 0
Share

Work around is probably the best way. Physics is complex, the location of an item in a 3D, or even 2D space is based on lots calculations so expect it to be a little twitchy. With lots of boxes edges will get out of alignment.

Can you place a collider just slightly over the top of the all the cubes at that level to smooth out edge detection to just that collider. Not always easy to do I know but the best I've got at the moment.

EDIT

No problem, it's a complex situation. No I didn't mean a massive collider for each height level, you're 100% right that wouldn't work and cause a whole heap of problems. Although my "random thoughts" $$anonymous$$d just thought "what if you only enable the colliders if they're below the player and a raycast hits a floor item just below the player".

Damn that wasn't what I wanted to write, it might work but only just thought of.

What I was originally going to say is, calculate the area of each level based on the cubes size and their size and set the collider size accordingly.

avatar image samqweqwe · Feb 05, 2015 at 09:34 PM 0
Share

so have a single collider for each level of the map? if so i dont think that it is suitable as it would not allow different objects be identified? wouldnt this prevent actions (such as death or increase jump height) be identified. or is there another way around, or have i misunderstood the fix? It seems like a good fix for a game with few platform types. Again, sorry for the lack of information.

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Why wont my character jump? (using rigidbody and addForce) 1 Answer

Cannot move and jump with rigid body. 0 Answers

Rigid body floating the air when I jump at a wall... how do I fix? 2 Answers

Jump forward then back initial position 0 Answers

Changing the speed and accelleration of a jump using the built-in Physics Rigidbody engine in Unity? 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