Search Unity

player does not collide with walls unity 5

Discussion in 'Editor & General Support' started by Johaneto, Apr 15, 2015.

  1. Johaneto

    Johaneto

    Joined:
    Apr 2, 2015
    Posts:
    4
    hola, I just started a new proyect with a personalize first person controller, like arrow move style, it worked, but when I tryed to collide it with walls it did not happen, I tryed adding a capsule, then adding the camera, rigidbody, character controller and my script to that capsule , then if you can see there are two walls one with box collider trigger the other one unchecked, it walks around but it does not collide at all, i'll add my controller script + scereenshot, thanks for you time
    <code>
    #pragma strict

    public var speed = 100.5;

    function Update () {
    //rotate
    var horizontalDir = parseFloat(Input.GetAxis("Horizontal") * speed * Time.deltaTime);
    transform.Rotate(0, horizontalDir, 0);

    //move backward and foreward
    var verticalDir = parseFloat(Input.GetAxis("Vertical") * (speed / 10) * Time.deltaTime);
    transform.Translate(0,0, verticalDir);
    }
    </code> upload_2015-4-14_19-24-14.png
     
  2. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93
    Hi, I think it's because capsule collider is triggered.
     
  3. Johaneto

    Johaneto

    Joined:
    Apr 2, 2015
    Posts:
    4
    did not work :(
     
  4. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93
    remove kinematic and check walls if triggered too.
     
  5. Johaneto

    Johaneto

    Joined:
    Apr 2, 2015
    Posts:
    4
    once I uncheck kinematic player falls down, so I tried to add an extra cube for the floor with and without is trigger checked, and still it does not work, then I put back the kinematic and realize that is not reconizing any physics at all it basically walks on the air(pic)...(alrady tried triggering and untriggering everithing) getting crazy now

    upload_2015-4-15_8-1-40.png