collision and performance for a robust arbitrary angled surface character controller

I wonder what you guy would do for a cheap replacement of character controller in unity. I try a bunch of implementation and they don’t work at all, what I’m doing wrong?

I’m trying to make a game with megadrive’s sonic pinball physics, think (technically) about mario galaxy meet tony hawk with sonic’s high speed. Currently I use a simple raytracing, but I’m looking to listen collision around the sphere collider.

In my case i tried:

  1. Rigidbody turn the game in a slide show, Intel atom n455 for the win (actually I like the limitation so it can run on most machine).
  2. Kinetic body don’t collide with scenery (don’t listen collision).
  3. Character controller don’t rotate.
  4. Sweeptest() and SweepTestAll() but walls and inward curve fails dramatically. + it does not work with the flash preview of unity 3.x

I want to be able to move the character according to tangent of arbitrary complex volumes. For example, taking slope change higher than 90° and leave the case handling with special case code (for example stopping at a wall or falling down a cliff)

What should I do to meet the requirement with good performance?

Currently my code is this one, with sweeptest() which doesn’t work:

private void UpdateSurfacePosition()
    {   
        Ray//origine, direction
            ground_check_ray = new Ray( gameObject.transform.position, -gameObject.transform.up);// * (Momentum.magnitude + 1));
        RaycastHit 
            raycast_result;
        Rigidbody
            rigid_body = gameObject.rigidbody;


        rigid_body.detectCollisions = false;
        rigid_body.isKinematic = true;



        bool onGround;// =
            //Physics.Raycast( ground_check_ray, out raycast_result );//ray, hit
            //rigid_body.SweepTest(-gameObject.transform.up, out raycast_result);//direction, hit, distance

        raycast_result = new RaycastHit();
        RaycastHit[] contacts = rigid_body.SweepTestAll(-gameObject.transform.up);

        rigid_body.SweepTest(-gameObject.transform.up, out raycast_result);


        if (contacts.Length > 0)
        {
            onGround = true;
            int i=0; while (i != contacts.Length)
            {
                raycast_result.normal += contacts[i].normal;
                i++;
            }
            raycast_result.normal = raycast_result.normal.normalized;
        }
        else
        {
            onGround = false;
        }


        debug1 = "Normal > " + raycast_result.normal.ToString()
            + " Position > "+ raycast_result.point.ToString()
                //+" transform > "+ raycast_result.transform.name.ToString()
                + " Contact > " + contacts.Length
                ;


        if ( onGround )
        {
            Vector3
                next_position;

            //UpdateOrientation( gameObject.transform.forward, raycast_result.normal );

            UpdateMoveOrientation( gameObject.transform.forward, raycast_result.normal );   
            next_position = GetNextPosition( raycast_result.point );
            rigid_body.MovePosition( next_position );


            //ground_direction = raycast_result.normal;
        }
        else//onAir
        {
            //if forward close to dot.Y = abs(1) choose -up if 1 and up if -1
            UpdateMoveOrientation( gameObject.transform.forward, raycast_result.normal );
        }
    }

http://forum.unity3d.com/threads/142375-The-limitations-of-the-physics-API-and-creating-a-character-controller

OKAY it’s just that unity can’t make any kind of complex gameplay at all, he confuse physics for collision, I just need a good system to resolve collision not to rewrite physX from scratch. No wonder any sane dev avoid unity for AAA. It’s cute for some simple game, nothing serious or too complex. I’m glad I haven’t bought the expensive useless license …