RigidBody jump over stair steps and small bumps

204006-screenshot-2023-01-18-234920.pngI want to make Rigidbody to jump over stairs steps…of any height…and also small bump. For example…going from Road to Pavement. I don’t want some quick hack like “Put a invisible slope over stairs”.

On searching on Google, I found I should use SphereCast but I never worked with it before. I’ve used RayCast before.

  • I don’t get how can I get normal or hitPoint from SphereCast as it’s very thick or sphere type RayCast?*

The image below is what I thought of doing but I don’t know how to find the height and I also don’t what to after raycasting the ray from player’s feet.

One way you could go about it is to tag the step objects, something like “steps.” Then have an empty object in front of the rigidbody then, you check if its hitting an object, and if that object tag is “steps.” If it is, add upward velocity until its not touching that object.