title: Collisions without physics
body: <p>I'm trying to make the simplest platformer prototype with the simplest physics (falling with gravity, moving left and right, and (maybe) jump). For example:</p>
  
  <pre><code>void Move () {
     if (!isDying || !isDead || !isShooting || !isFalling)
     {
       float amountToMove = Time.deltaTime * Input.GetAxis("Horizontal") * playerSpeed;
       transform.Translate(Vector3.right * amountToMove);
     }
  }
  
  void ApplyGravity() {
  
     float amountToMove = Time.deltaTime * gravity;
     transform.Translate(Vector3.down * amountToMove);
  
  }
  </code></pre>
  
  <p>The problem is i don't know how to make collisions without physics and with isKinematic enabled. The only thing i know is to use a OnTriggerEnter function, so added a isTrigger to all objects and wrote (Hero.cs):</p>
  
  <pre><code> void OnTriggerEnter (Collider otherGameObjectCollider) {
     if (otherGameObjectCollider.gameObject.tag == "ground") {
       Debug.Log("ground/wall collision");
     }
  }
  </code></pre>
  
  <p>I know that i need stop my hero to prevent falling (walking) through the ground but i really can't think it out.</p>
  
  <p>Sorry for the dumb question.</p>