Search Unity

Rigidbody based FPS-walker - walking over steps

Discussion in 'Scripting' started by runevision, Apr 8, 2008.

  1. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    I realize there have been many questions about this topic, but here is another one.

    How can I make a Rigidbody based character controller that rolls smoothly over steps similar to how the the specialized CharacterController does?

    I have tested some Rigidbody based controllers from the Unify WIKI, but they come to a crawl when ever there's even a low step ahead.

    The CharacterController has a property called "Skin Width" that is described this way:
    :?: How does this Skin Width work, and can something similar be done for Rigidbody based controllers?

    A few notes:
    :arrow: I can't simply use ramps for colliders instead of steps for this project.
    :arrow: The idea is to make the Rigidbody hover slightly over the ground, like the CharacterController does with Skin Width. However, I don't know how to best do this. Raycasts are an option, but to get the right rolling effect, many would be required. This is why I'd like to know how it's done in the CharacterController, and if it can be transferred to a Rigidbody based controller.

    Also, I have seen a lot of different FPS scripts. It's difficult to say if the ones on the WIKI are the best, or if there are better gems lying around. However, several of them are from 2006 and I don't know if they work well with Unity 2.0.

    :arrow: These are all the different Rigidbody based FPS walker scripts I could find:

    The ones on the WIKI:
    http://www.unifycommunity.com/wiki/index.php?title=RigidbodyFPSWalker
    http://www.unifycommunity.com/wiki/index.php?title=PhysicsFPSWalker

    Yoggi's, from 2006, that moves with with objects it is standing on (link to actual file is dead):
    http://forum.unity3d.com/viewtopic.php?p=8595#8595

    Nicholas', from 2006, that pushes other Rigidbodies:
    http://forum.unity3d.com/viewtopic.php?p=15691#15691

    Joachim Ante's, from 2006, that also handles when standing on moving rigidbodies. Modifications by others in same thread:
    http://forum.unity3d.com/viewtopic.php?p=22407#22407

    As far as I can tell, none of them handles the step problem mentioned in this post.
    Also, it would be really nice with a "best of breeds" script that combines the strengths from all the different scripts in an updated version. It seems to be really often requested after all.

    Rune