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 Hoeloe · Aug 28, 2013 at 02:09 PM · colliderplatformsteps

Step Height without CharacterController

So I'm making a game, and I'm having an issue with colliders. My player has a box collider attached, along with a rigidbody (I'm handling input and most of the physics myself, because I wanted something more customisable and less realistic than Unity's built-in system). I cannot use a different collider type for various reasons. The game is quite high speed, and it all works perfectly fine so long as I'm on the terrain. However, I have a few cases where I move from the terrain to another collider (often other box colliders, occasionally mesh colliders).

This is where problems occur. It seems there is no leniency in the collider to allow it to transfer smoothly from one to the other (as the step height value achieves with character controllers). Instead, the player will just freeze in place, even when the difference in collider height is so small that it's almost impossible to see (even when zoomed in). I have tried creating my own step height algorithm by raising the collider slightly every time it enters a new ground collider, and this works to an extent, but the issue still occurs at low speeds, and when it does work, it causes a weird "bouncing" effect.

I believe the effect comes from the fact that colliders sink into each other slightly before registering a collision. I have tried to regulate this in the physics manager by setting "Min Penetration For Penalty" to 0.001 (I even tried it at 0, which didn't help at all), and "Solver Iteration Count" to 50. Can anyone help me to sort out this issue, to make transferring between "platforms" smooth?

Comment
Add comment · Show 7
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 Lairinus · Aug 28, 2013 at 02:20 PM 0
Share

Whenever I didn't use a box collider, this is what happened:

  • $$anonymous$$y character fell over

  • After my character's jump, it fell over

  • If I went up a ramp, my character fell over

  • $$anonymous$$y character would stutter up ramps, then fall over

  • $$anonymous$$y character would spin/rotate through objects

  • $$anonymous$$y character would hit the terrain collider, stop, start going forward again, and before it could it would fall through the terrain.

After about a month of this I decided that it would be smart to lock the rotation of a specific axis to make it impossible to fall over.

Box Colliders are a quick fix for the problem, sure, but understanding that they're limited in terms of movement is the first step.

I'm not one for giving out free codes (until my free package comes out that I'm working on), but If you lock one, or even two axis, and release them when you jump/fall/ whatever, you'll see a huge improvement.

I also use my own physics stuff, and I use a capsule collider.

This may not answer all of your questions, but using a character with a box collider will cause stutter-- most stutter in Unity is from colliders colliding with colliders. (That was ugly)

As far as the settings that you're changing: with my method I haven't changed any around and I have no problem walking up / with stutter.

After this, your question should be "How can I LI$$anonymous$$IT step height?" Still working on that one.

avatar image Hoeloe · Aug 28, 2013 at 02:32 PM 0
Share

But my issue isn't the character falling over, it's the character literally SLIDING around on the ground. In fact, in order for my physics engine to work ALL rotation axis must be locked. There are other reasons why a box collider is most suitable. Also, I tried with a capsule collider, ignoring the sliding issue, and it did not fix the problem.

On another note, I did a bit more testing, and it seems I can fix the problem by INCREASING the $$anonymous$$in Penetration For Penalty. However, when I do so, the character sinks through the floor (which is of course expected), causing (other than the obvious graphical flaw) issues such as certain sounds not playing correctly, and trails made by my custom trail emitter to not work correctly. $$anonymous$$oving the collider down to counteract the change also counteracts the fix, so it seems I can have one issue or the other.

avatar image Hoeloe · Aug 28, 2013 at 02:37 PM 0
Share

Hmm... So, since I've been handling physics myself, I've completely ignored Physic $$anonymous$$aterials. I decided to see what effect it had, and so I created one, with 0 static and dynamic friction, and 0.2 bounciness, and applied it to my character collider. The problem seems to have virtually disappeared, but I'll do a bit more testing.

avatar image Hoeloe · Aug 28, 2013 at 03:48 PM 0
Share

I have found, with a bit more testing, that having some "bounciness" improves the issue, but doesn't remove it. I'm keen to keep the bounciness low, as it causes weirdness in other areas, so I'd still be keen for an alternative answer.

avatar image Hoeloe · Sep 02, 2013 at 02:56 PM 0
Share

Having built some more of my level, it seems that this fix only happened to work in the circumstances I already had set up, so I'm back to square one again. I really do need help here. I can't seem to get any step script working either, as it's extremely difficult to tell when the rigidbody is prevented from moving in a specific direction due to a collision.

Show more comments

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

17 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

Related Questions

Animation affects the rotation.. 1 Answer

How do I stop a player from bouncing on a descending platform? 1 Answer

Ethan controller rotation and collider problems on moving platform 0 Answers

(Super Mario)Collide when walking on multiple box-collider platform 3 Answers

Character "snaps" to one-way PlatformEffector2D? 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