Simulate CharacterController::Move With Rigidbody Coll

hi everyone,
i have a problem when move around a ball it will penetrate the ground then pops back onto ground surface. Current settings for the ball is rigidbody + Capsule Collider, i move it via changing directly its transform.position. i tried to use rigidbody.MovePosition inside OnFixedUpdate, anyway it will still penerate (then pops back).

i know this wont happen if i use a CharacterController (CharacterController::Move) instead but in this case i’ll have to stick with Rigidbody + Capsule Collider, so any hints what to do to prevent the penetration from happening? thank you.

newtext

If it’s a ball shouldn’t you be using a sphereCollider?

Also, trying using rigidbody.AddForce().

thanks MitchStan,

i now have a simple way to get this around :

  1. everyframe i cast a ray to the ground from the ball position, so i get a ray-ground intersection point
  2. make another point “base point”, which will be under ground along the ray direction
  3. clamp the magnitude of (ball position - base point), make it >= the magnitude of (ray-ground intersection - base point)

there might be other problems but the result so far looks good to me.

any other hints would be welcome, thank you.